From 76cfabee5b14b156a313ed74ec67c7fa7ab2fcf1 Mon Sep 17 00:00:00 2001 From: Thomas Sibley Date: Fri, 5 Feb 2021 15:49:34 -0800 Subject: [PATCH] wip! manage apache and shibboleth Ensure both are installed and configured. XXX TODO: move config files in backoffice-apache2.git and backoffice-shibboleth.git into this repo with history preserved by creating a branches in them that move files into appropriate locations, adding those repos as new remotes to this one, and merging said branches into master here. --- backoffice.yaml | 11 +++++++++++ tasks/apache.yaml | 28 ++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 tasks/apache.yaml diff --git a/backoffice.yaml b/backoffice.yaml index 0ea4a4a..51913b1 100644 --- a/backoffice.yaml +++ b/backoffice.yaml @@ -12,6 +12,7 @@ tasks: - import_tasks: tasks/apt-update.yaml + - import_tasks: tasks/apache.yaml - import_tasks: tasks/systemd.yaml - import_tasks: tasks/prometheus.yaml - import_tasks: tasks/uwsgi.yaml @@ -23,6 +24,16 @@ systemd: daemon_reload: yes + - name: apache is restarted + service: + name: apache2 + state: restarted + + - name: apache is reloaded + service: + name: apache2 + state: reloaded + - name: prometheus is restarted service: name: prometheus diff --git a/tasks/apache.yaml b/tasks/apache.yaml new file mode 100644 index 0000000..1238f5b --- /dev/null +++ b/tasks/apache.yaml @@ -0,0 +1,28 @@ +--- +- name: switchaai apt-source package is installed + apt: + deb: https://pkg.switch.ch/switchaai/ubuntu/dists/bionic/main/binary-all/misc/switchaai-apt-source_1.0.0ubuntu1_all.deb + register: switchaai_source_pkg + +- name: apt cache is up-to-date after new source installed + apt: + update_cache: true + when: switchaai_source_pkg.changed + +- name: apache is installed + apt: + package: + - apache2 + - libapache2-mod-proxy-uwsgi + - libapache2-mod-shib + - libapache2-mod-wsgi-py3 + - python3-certbot-apache + +- name: apache is enabled + service: + name: apache2 + enabled: yes + state: started + +# XXX TODO: merge backoffice-apache2.git and backoffice-shibboleth.git into +# this repo and manage their installation, etc.