Automate Archives: archive, unarchive and fetch

Before a web upgrade WebAsha wants the Apache configuration of both production servers backed up and copied to control, the new site unpacked on the web servers, and old application logs on test rolled into a compressed archive. `community.general` is installed in `~/ansible/collections`; the new site is in `~/ansible/files/site.tar.gz`.

Tasks

  1. Write ~/ansible/backup.yml: on the webservers, archive /etc/httpd/conf into /root/httpd-conf.tar.gz (gzip).
  2. Extend backup.yml to copy each archive back to control as ~/ansible/backups/<host-httpd-conf.tar.gz (e.g. backups/node3-httpd-conf.tar.gz).
  3. Write ~/ansible/site.yml: unpack files/site.tar.gz from control into /var/www/html on the webservers only.
  4. Write ~/ansible/posix.yml: on dev, create /opt/posix and unpack http://utility/collections/ansible-posix-1.6.2.tar.gz straight from the URL into it.
  5. Write ~/ansible/logs.yml: on test, archive all /var/log/webasha/.log into /root/webasha-logs.tar.bz2 (bzip2) and remove the original log files.