RH294 Ch 8: Host Patterns, Imports and Tags

The inventory in `~/ansible` has node1 in `dev` and node2, node3 in `prod`. Split the work into small playbooks and task files, then tie them together with a master `site.yml`.

Tasks

  1. Write ~/ansible/users.yml that creates user webops on all hosts. Tag the task users.
  2. Write ~/ansible/dirs.yml that creates directory /opt/reports on every prod host except node3, using a host pattern (not a when). Tag the task reports.
  3. Put a task that writes /etc/motd with the text Managed by Ansible in its own file ~/ansible/tasks/motd.yml, and write ~/ansible/web.yml that runs it on dev with importtasks or includetasks.
  4. Write ~/ansible/site.yml that imports users.yml, dirs.yml and web.yml with importplaybook, passes --syntax-check, and run it.
  5. ansible-playbook site.yml --list-tags must show both tags users and reports.