diff --git a/playbooks/deploy.yaml b/playbooks/deploy.yaml index 6955b02..da2937f 100644 --- a/playbooks/deploy.yaml +++ b/playbooks/deploy.yaml @@ -64,3 +64,6 @@ - "o=${distro_id},n=${distro_codename}" - "o=Docker,n=${distro_codename}" - "o=nginx,n=${distro_codename}" + +- name: Run ensure_eh22_styleguide_dir Playbook + ansible.builtin.import_playbook: ensure_eh22_styleguide_dir.yaml diff --git a/playbooks/ensure_eh22_styleguide_dir.yaml b/playbooks/ensure_eh22_styleguide_dir.yaml new file mode 100644 index 0000000..a57f49d --- /dev/null +++ b/playbooks/ensure_eh22_styleguide_dir.yaml @@ -0,0 +1,40 @@ +--- +# TODO: This should really be handled through a role at some point. +# This role is also needed for migrating public-web-static to Ansible. +- name: Ensure base for working EH22 Styleguide CI deployment + hosts: eh22-wiki + tasks: + - name: Ensure deployment user group + ansible.builtin.group: + name: eh22-styleguide-deploy + system: false + become: true + + - name: Ensure deployment user + ansible.builtin.user: + name: eh22-styleguide-deploy + group: eh22-styleguide-deploy + password: '!' + system: false + become: true + + - name: Ensure SSH key is set for deployment user + ansible.posix.authorized_key: + user: eh22-styleguide-deploy + exclusive: true + key: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOEgdXYZUq6SUDeKpX0Q8d1WYJ5WduHPMEaRuj0yfJTl deploy key for eh22 styleguide" + become: true + + - name: Ensure deployment directory + ansible.builtin.file: + path: /var/www/eh22-styleguide + state: directory + mode: "0755" + owner: eh22-styleguide-deploy + group: eh22-styleguide-deploy + become: true + + - name: Ensure rsync is present for deployment + ansible.builtin.apt: + name: rsync + become: true diff --git a/resources/chaosknoten/eh22-wiki/nginx/eh22.easterhegg.eu.conf b/resources/chaosknoten/eh22-wiki/nginx/eh22.easterhegg.eu.conf index 631ba7d..3ccbd2e 100644 --- a/resources/chaosknoten/eh22-wiki/nginx/eh22.easterhegg.eu.conf +++ b/resources/chaosknoten/eh22-wiki/nginx/eh22.easterhegg.eu.conf @@ -63,4 +63,13 @@ server { fastcgi_param REDIRECT_STATUS 200; fastcgi_pass unix:/var/run/php/php-fpm-dokuwiki.sock; } + + location = /design { + return 302 https://eh22.easterhegg.eu/design/; + } + + location /design/ { + alias /var/www/eh22-styleguide/; + index index.html; + } }