Postgres: changed image to the :alpine

All: Check if nginx config exists before updating. This is to prevent overwriting of certbot-auto certificates and redirect
This commit is contained in:
tanshu
2020-04-03 13:01:44 +05:30
parent 2c77fdd5a7
commit 518871ff16
5 changed files with 29 additions and 20 deletions

View File

@ -24,12 +24,21 @@
volumes:
- /var/lib/trilium:/root/trilium-data
- name: Sets Nginx conf file for trilium
- name: Check if Nginx conf file exists
stat: path="/etc/nginx/sites-available/{{ http_conf }}"
register: status
- name: No need to reload Nginx
debug: msg= {{ "No need to reload Nginx as sites-available entries have already been created" }}
- name: Set Nginx conf file
when: status.stat.exists == false
template:
src: "files/nginx.conf.j2"
dest: "/etc/nginx/sites-available/{{ http_conf }}"
- name: Enables new site
- name: Enable new site
when: status.stat.exists == false
file:
src: "/etc/nginx/sites-available/{{ http_conf }}"
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
@ -42,7 +51,3 @@
name: nginx
state: reloaded
- name: Restart Nginx
service:
name: nginx
state: restarted