Skip to content
Snippets Groups Projects
Commit a690a4df authored by MichiK's avatar MichiK
Browse files

Add role for static website deployment

parent 1a0867ff
No related branches found
No related tags found
No related merge requests found
...@@ -11,12 +11,13 @@ acmetool_cert_domains: ...@@ -11,12 +11,13 @@ acmetool_cert_domains:
- www.c3heaven.de - www.c3heaven.de
angelguide_deployment_path: "/var/www/angelguide" angelguide_deployment_path: "/var/www/angelguide"
website_deployment_path: "/var/www/static"
nginx_https_sites: nginx_https_sites:
- name: "c3heaven.de" - name: "c3heaven.de"
locations: locations:
- location: "/" - location: "/"
config: "root /var/www/html;" config: "root {{ website_deployment_path }};"
- location: "~ /wiki(.*)$" - location: "~ /wiki(.*)$"
config: "return 301 https://wiki.c3heaven.de$1?$args;" config: "return 301 https://wiki.c3heaven.de$1?$args;"
- location: "~ /kanboard(.*)$" - location: "~ /kanboard(.*)$"
......
website_deployment_user: website
website_deployment_path: /var/www/static
website_deployment_keys:
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMW+8/hse/foM2TWgM5MA6LuT4A/eb0/biFUQwLt85nN
- name: create website deployment user
user:
name: "{{ website_deployment_user }}"
home: "{{ website_deployment_path }}"
system: yes
shell: /bin/sh
- name: create .ssh directory for the website user
file:
path: "{{ website_deployment_path }}/.ssh"
state: directory
- name: copy website deployment ssh keys
template:
src: authorized_keys.j2
dest: "{{ website_deployment_path }}/.ssh/authorized_keys"
{% for key in website_deployment_keys %}
command="/usr/local/bin/rrsync {{ website_deployment_path }}",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding {{ key }}
{% endfor %}
# Add directories, users, SSH keys etc. needed for automatic web deployment # Add directories, users, SSH keys etc. needed for automatic web deployment
# of e.g. the angel guide via Gitlab CI # of e.g. the angel guide via Gitlab CI
- name: allow angelguide deployment - name: allow website and angelguide deployment
hosts: gabriel.c3heaven.de hosts: gabriel.c3heaven.de
become: yes become: yes
roles: roles:
- angelguide-deployment - angelguide-deployment
- website-deployment
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment