Three sites run on app1 — shop, blog and docs, each with its own playbook in ~/ansible-lab. A colleague wrote shop.yml for Ansible and copied it for the other two sites. Yesterday he changed the support phone on the pages to 8-800-555-02-02 and ran all three playbooks. See what the sites return and what the playbooks say.
Look at the sites and the playbooks
In ~/ansible-lab see what the three sites return, and find the support phone and the database password in the playbooks.
First, predict
Your colleague changed the phone and ran all three playbooks without errors. On how many sites will curl show 8-800-555-02-02?
Now start the exercise, run the command and compare your prediction with the output.
Your colleague changed the phone in shop.yml and ran all three playbooks, yet blog and docs show the old number. Why?
-
The runs went through, and the blog and docs pages are as their playbooks say:
grep -n '8-800' *.ymlshows the old number in blog.yml and docs.yml. -
nginx reads the page from disk on every request:
cat /srv/blog/index.htmlshows the same number as curl. -
Each run applies its own playbook in full. Nobody wrote the new number into blog.yml and docs.yml —
grep -n '8-800' *.yml.
The three playbooks are independent copies of the tasks, and the other two do not see an edit in shop.yml.