美文网首页运维日常
playbook实现所有web主机安装Apache

playbook实现所有web主机安装Apache

作者: 大白菜的猪猪 | 来源:发表于2020-04-11 12:28 被阅读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

    相关文章

      网友评论

        本文标题:playbook实现所有web主机安装Apache

        本文链接:https://www.haomeiwen.com/subject/ckhymhtx.html