On Github a-fro / ansible-iwp
Created for the Ithaca Web People Meetup by @aaronfroehlich
[dev]
a-fro.dev
[staging]
stage.a-fro.com
[production]
a-fro.com
[droplets:children]
staging
production
ansible production -m ping -i inventory
ansible production -m ping -i inventory
---
- name: Get software for Python-based control.
apt: "pkg={{ item }} state=installed"
with_items:
- curl
- python-apt
- python-pycurl
---
domain: "ithacawebpeople.dev"
webroot: "/var/www/{{ domain }}"
repo_url: "git@github.com:a-fro/ansible-iwp.git"
apache_vhosts:
- {servername: "{{ domain }}", documentroot: "{{ webroot }}"}
---
- hosts: drupal7
tasks:
- name: Download drupal core patch.
get_url:
url: https://www.drupal.org/files/issues/SA-CORE-2014-005-D7.patch
dest: /tmp/SA-CORE-2014-005-D7.patch
- name: Apply the patch from the drupal docroot.
shell: "patch -p1 < /tmp/SA-CORE-2014-005-D7.patch chdir={{ drupal_docroot }}"
- name: Restart apache (or nginx, and/or php-fpm, etc.) to rebuild opcode cache.
service: name=httpd state=restarted
- name: Clear Drupal caches (because it's always a good idea).
command: "drush cc all chdir={{ drupal_docroot }}"
- name: Ensure we're not vulnerable anymore.
[redacted]