RH294 Ch 7: Deploy Files with Templates and File Modules

The project in `~/ansible` already reaches node1 (group `dev`) and node2 (group `prod`). Write one or more playbooks that push WebAsha's standard files to the nodes using Jinja2 templates and the file modules. Each node also has `/etc/webasha/app.conf` that needs editing in place.

Tasks

  1. On every node, deploy /etc/motd from a Jinja2 template in ~/ansible/templates/ so that line 1 is Welcome to <hostname and line 2 is Memory: <total RAM in MB MB (use facts).
  2. On the dev hosts only, create /etc/myhosts from a template that loops over every host in the inventory and writes one line per host: <IPv4 address <FQDN <short name.
  3. In /etc/webasha/app.conf on every node, change the line loglevel=debug to loglevel=info without touching the rest of the file.
  4. Append a managed block to /etc/webasha/app.conf on every node containing the two lines maxclients=100 and timeout=30.
  5. On the prod hosts only: create /srv/webasha/index.txt containing Deployed by Ansible, owned by devops with mode 0640, and a symbolic link /srv/current pointing to /srv/webasha.