From 968c05c76eaed6efc6228a9a8ade915bd03b1b58 Mon Sep 17 00:00:00 2001 From: Fabio Sinibaldi Date: Fri, 29 May 2026 14:29:14 +0200 Subject: [PATCH] Fixed templates folder --- ansible/playbooks/bootstrap.yml | 2 +- .../templates/ansible_auth_keys.j2 | 0 ansible/playbooks/templates/nginx.j2 | 29 +++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) rename ansible/playbooks/{library => }/templates/ansible_auth_keys.j2 (100%) create mode 100644 ansible/playbooks/templates/nginx.j2 diff --git a/ansible/playbooks/bootstrap.yml b/ansible/playbooks/bootstrap.yml index a1ce237..52840fe 100644 --- a/ansible/playbooks/bootstrap.yml +++ b/ansible/playbooks/bootstrap.yml @@ -56,5 +56,5 @@ file: path=/home/ansible/.ssh owner=ansible group=ansible mode=0700 state=directory - name: Add the mandatory ssh keys to the ansible user - template: src=library/templates/ansible_auth_keys.j2 dest=/home/ansible/.ssh/authorized_keys owner=ansible group=ansible mode=0644 + template: src=templates/ansible_auth_keys.j2 dest=/home/ansible/.ssh/authorized_keys owner=ansible group=ansible mode=0644 diff --git a/ansible/playbooks/library/templates/ansible_auth_keys.j2 b/ansible/playbooks/templates/ansible_auth_keys.j2 similarity index 100% rename from ansible/playbooks/library/templates/ansible_auth_keys.j2 rename to ansible/playbooks/templates/ansible_auth_keys.j2 diff --git a/ansible/playbooks/templates/nginx.j2 b/ansible/playbooks/templates/nginx.j2 new file mode 100644 index 0000000..38fa67f --- /dev/null +++ b/ansible/playbooks/templates/nginx.j2 @@ -0,0 +1,29 @@ +server { + listen 80; + listen [::]:80; + server_name {{ nginx_server_name }}; + + location / { + return 301 https://$host$request_uri; + } +} + +server { + listen 443 ssl; + server_name {{ nginx_server_name }}; + + root /var/www/html; + index index.php; + + ssl_certificate /etc/nginx/ssl/fullchain.pem; + ssl_certificate_key /etc/nginx/ssl/privatekey.pem; + ssl_trusted_certificate /etc/nginx/ssl/intermediatecertificate.pem; + + location / { + proxy_pass http://{{ docker_wordpress_hostname }}:80; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } +} \ No newline at end of file