- name: install and configure web servers hosts: webservers tasks: - name: install apache package yum: name=httpd state=present - name: write the apache config file template: src=t/httpd.j2 dest=/etc/httpd.conf - name: ensure apache is running (and enable it at boot) service: name=httpd state=started enabled=yes