name: ensure apache is at the latest version yum: pkg=httpd state=latest - name: write the apache config file template: src=/srv/httpd.j2 dest=/etc/httpd.conf - hosts: databases remote_user: root tasks: - name: ensure postgresql is at the latest version yum: name=postgresql state=latest - name: ensure that postgresql is started service: name=postgresql state=running 42 — David Murphy @ WordCamp US, December 2015
name=httpd state=latest - name: remove the Apache package yum: name=httpd state=absent - name: install the latest version of Apache from↩ the testing repo yum: name=httpd enablerepo=testing state=present - name: install one specific version of Apache yum: name=httpd-2.2.29-1.4.amzn1 state=present 44 — David Murphy @ WordCamp US, December 2015
owner=bin group=wheel mode=0644 # The same example, but using symbolic modes equivalent to 0644 - template: src=/mytemplates/foo.j2 dest=/etc/file.conf↩ owner=bin group=wheel mode="u=rw,g=r,o=r" 45 — David Murphy @ WordCamp US, December 2015
running - service: name=httpd state=started # Example action to stop service httpd, if running - service: name=httpd state=stopped # Example action to restart service httpd, in all cases - service: name=httpd state=restarted # Example action to reload service httpd, in all cases - service: name=httpd state=reloaded # Example action to enable service httpd, and not touch↩ the running state - service: name=httpd enabled=yes 46 — David Murphy @ WordCamp US, December 2015