The shop site on app1 is deployed by a colleague's playbook — the ~/ansible-lab/site.yml file with steps for Ansible. It has already been applied, and the site on port 8080 works. But every run breaks visitors' connections. Run the playbook once more and see what it does.
Run the playbook once more
In ~/ansible-lab look at the site.yml playbook, run it once more and see when nginx was started.
First, predict
The playbook is already applied and the site works. How many tasks will the run mark as changed?
Now start the exercise, run the command and compare your prediction with the output.
The playbook is already applied, yet the repeated run marked all three tasks changed again. Why?
-
A module with nothing to change answers ok: the second
ansible web -m copy …in the previous lesson answered SUCCESS with"changed": false. -
The files are the same: the run writes them again with the same content.
cat /srv/shop/index.htmlbefore and after the run shows the same thing. -
A restart does not touch the files, and it is only the third task; the two file tasks say changed too.
All three tasks are shell, and shell answers changed on every run.