- name: Ensure apache is installed and started
hosts: web
become: yes
tasks:
- name: Ensure httpd package is present
yum:
name: httpd
state: latest
- name: Ensure latest index.html file is present
copy:
src: files/index.html
dest: /var/www/html/index.html
- name: Ensure httpd is started
service:
name: httpd
state: started