Skip to content

Ansible Commands for CMS

Resources

Getting set up to run Ansible commands

TODO: Detail process to configure Ansible and clone playbooks / roles

  1. Log on to util1 (gatekeeper)
  2. sudo su - appsctl
  3. cd to your ansible-work directory
  4. cd ansible-playbooks

Push Configurations to CMSW (Dispatcher) Machines

ansible-playbook -i inventory/prod.hosts --vault-password-file ../nexus -t config cms-web.yml

Clone / Update Certificates

  1. cd ${ANSIBLE_WORK}/ansible-playbooks/templates/certificates
  2. git pull origin master
  3. ansible-playbook -i inventory/prod.hosts --vault-password-file ../nexus -e service=CMS cms-certs.yml

Running this play requires the certificate password. pass -c web/cms/cms-cert-store

Reload Apache Configuration

https://code.vt.edu/es/server-provisioning/ansible/ansible-playbooks

On a Dispatcher host

$ apachectl-AEM graceful
or

$ apachectl-AEM stop && watch apache-mem && apachectl-AEM start

From util1

$ ansible app-aem-web -i inventory/prod.hosts -l cmsw-prod-04.hosting.vt.edu --become --become-user cms -m shell -a '/apps/cms/etc/init.d/apachectl-AEM graceful'
  • The -l (limit) directive runs this on one machine at a time.
  • Watch for success or failure results in the shell.
  • Watch the overall status in the [Apache Web Servers](https://webapps.es.vt.edu/status/d/000000011/apache-web-servers?refresh=5m&orgId=1. Grafana page.

Touch .stat file (invalidate cache)

Replace <sitename> with the actual site name. Remember to use underscores _ to separate name parts.

appsctl@util1: $ ansible app-aem-web -i inventory/prod.hosts --become --become-user cms -m file -a 'path=/apps/cms/var/cache/AEM/content/<sitename>_vt_edu/en/.stat state=touch'
mod_dispatcher compares the timestamp on .stat to the timestamp on a requested page/image/etc, and fetches a new rendering if older than .stat. This procedure makes every cached item older than the stat file.