[deyu1@kvm19 ansible]$ vim roles/apache/tasks/main.yml [deyu1@kvm19 ansible]$ cat roles/apache/tasks/main.yml --- - name: install the latest version of Apache yum: name: httpd state: latest - name: Start service httpd service: name: httpd state: started enabled: yes - name: Enable service firewalld service: name: firewalld enabled: yes state: started - name: firewalld add http service firewalld: service: http permanent: yes state: enabled immediate: yes