move roles, files and templates dirs out of playbook dir into root dir

Because of how Ansible local relative search paths work, the global
"files" and "templates" directories need to be next to the playbooks.
However its not intuitive to look into the "playbooks" directory to find
the files and templates for a host.
Therefore move them out of the "playbooks" directory into the root
directory and add symlinks so everything still works.

Similarly for local roles, they also need to be next to the playbooks.
So for a nicer structure, move the "roles" directory out into the root
directory as well and add a symlink so everything still works.

Also see:
https://docs.ansible.com/ansible/latest/playbook_guide/playbook_pathing.html#resolving-local-relative-paths
https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_reuse_roles.html#storing-and-finding-roles
This commit is contained in:
June 2024-12-02 03:34:55 +01:00
commit f16f8697c2
Signed by: june
SSH key fingerprint: SHA256:o9EAq4Y9N9K0pBQeBTqhSDrND5E7oB+60ZNx0U1yPe0
147 changed files with 3 additions and 0 deletions

View file

@ -0,0 +1,58 @@
---
services:
nextcloud:
image: git.hamburg.ccc.de/ccchh/oci-images/nextcloud:{{ nextcloud__version }}
pull_policy: always
restart: unless-stopped
ports:
- "8080:80"
depends_on:
- db
- redis
networks:
- nextcloud
volumes:
{% if nextcloud__use_custom_new_user_skeleton %}
- "./custom_new_user_skeleton:/custom_new_user_skeleton"
{% endif %}
- "./nextcloud_var_www_html:/var/www/html"
- "{{ nextcloud__data_dir }}:/var/www/html/data"
environment:
POSTGRES_HOST: db
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: "{{ nextcloud__postgres_password }}"
NEXTCLOUD_ADMIN_USER: admin
NEXTCLOUD_ADMIN_PASSWORD: "{{ nextcloud__admin_password }}"
REDIS_HOST: redis
NEXTCLOUD_TRUSTED_DOMAINS: "{{ nextcloud__fqdn }}"
# See here: https://github.com/nextcloud/docker#using-the-apache-image-behind-a-reverse-proxy-and-auto-configure-server-host-and-protocol
APACHE_DISABLE_REWRITE_IP: 1
TRUSTED_PROXIES: 127.0.0.1
OVERWRITECLIURL: "https://{{ nextcloud__fqdn }}/"
OVERWRITEHOST: "{{ nextcloud__fqdn }}"
OVERWRITEPROTOCOL: "https"
db:
image: postgres:{{ nextcloud__postgres_version }}
restart: unless-stopped
#ports:
# - 127.0.0.1:5432:5432
networks:
- nextcloud
volumes:
- "./database:/var/lib/postgresql/data"
environment:
POSTGRES_DB: nextcloud
POSTGRES_USER: nextcloud
POSTGRES_PASSWORD: "{{ nextcloud__postgres_password }}"
redis:
image: redis:alpine
restart: unless-stopped
networks:
- nextcloud
networks:
nextcloud:
external: false

View file

@ -0,0 +1,61 @@
# also see here:
# - https://docs.nginx.com/nginx/admin-guide/load-balancer/using-proxy-protocol/
# - https://nginx.org/en/docs/http/ngx_http_realip_module.html
server {
# Listen on a custom port for the proxy protocol.
listen 8443 ssl http2 proxy_protocol;
# Make use of the ngx_http_realip_module to set the $remote_addr and
# $remote_port to the client address and client port, when using proxy
# protocol.
# First set our proxy protocol proxy as trusted.
set_real_ip_from {{ nextcloud__proxy_protocol_reverse_proxy_ip }};
# Then tell the realip_module to get the addreses from the proxy protocol
# header.
real_ip_header proxy_protocol;
# This should work, but isn't needed for now.
# # Still listen for https on 443 as usual.
# listen 443 ssl http2;
# #listen [::]:443 ssl http2;
server_name {{ nextcloud__fqdn }};
ssl_certificate /etc/letsencrypt/live/{{ nextcloud__fqdn }}/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/{{ nextcloud__fqdn }}/privkey.pem;
# verify chain of trust of OCSP response using Root CA and Intermediate certs
ssl_trusted_certificate /etc/letsencrypt/live/{{ nextcloud__fqdn }}/chain.pem;
# replace with the IP address of your resolver
resolver 1.1.1.1;
# allow uploads of any size
client_max_body_size 0;
location /.well-known/carddav {
# HSTS (ngx_http_headers_module is required) (63072000 seconds)
add_header Strict-Transport-Security "max-age=63072000" always;
return 301 $scheme://$host/remote.php/dav;
}
location /.well-known/caldav {
# HSTS (ngx_http_headers_module is required) (63072000 seconds)
add_header Strict-Transport-Security "max-age=63072000" always;
return 301 $scheme://$host/remote.php/dav;
}
location / {
proxy_set_header Host $host;
# This is https in any case.
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# HSTS (ngx_http_headers_module is required) (63072000 seconds)
add_header Strict-Transport-Security "max-age=63072000" always;
add_header Front-End-Https on;
proxy_pass http://127.0.0.1:8080;
}
}