Ansible Commands for CMS
Resources
Getting set up to run Ansible commands
TODO: Detail process to configure Ansible and clone playbooks / roles
- Log on to util1 (gatekeeper)
sudo su - appsctlcdto your ansible-work directorycd ansible-playbooks
Push Configurations to CMSW (Dispatcher) Machines
Clone / Update Certificates
cd ${ANSIBLE_WORK}/ansible-playbooks/templates/certificatesgit pull origin masteransible-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
orFrom 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'
.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.