运维日常

playbook实现所有web主机安装Apache

2020-04-11  本文已影响0人  大白菜的猪猪

---

- hosts: web

  remote_user: root

  tasks:

    - name: install one specific version of Apache

      yum:

        name: httpd

        state: install

    - lineinfile:

        path: /etc/httpd/conf/httpd.conf

        regexp: '^Listen'

        line: 'Listen 8080'

    - service:

        name: httpd

        enabled: yes

        state: restarted

    - copy:

        src: /root/index.html

        dest: /var/www/html/index.html

上一篇下一篇

猜你喜欢

热点阅读