Gitea: Only update nginx if conf files do not exist to prevent fucking up let's encrypt certificate and redirect.
This commit is contained in:
parent
e0e7b07468
commit
9264828051
@ -40,15 +40,30 @@
|
|||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
# - name: Sets Nginx conf file for gitea
|
- name: Check if Nginx conf file for gitea exists or not
|
||||||
# template:
|
stat: path="/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
# src: "files/nginx.conf.j2"
|
register: status
|
||||||
# dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
|
||||||
|
|
||||||
# - name: Enables new site
|
- name: No need to reload Nginx
|
||||||
# file:
|
debug: msg= {{ "No need to reload Nginx as sites-available entries have already been created" }}
|
||||||
# src: "/etc/nginx/sites-available/{{ http_conf }}"
|
|
||||||
# dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
- name: Sets Nginx conf file for gitea
|
||||||
# state: link
|
when: status.stat.exists == false
|
||||||
# notify: Reload Nginx
|
template:
|
||||||
|
src: "files/nginx.conf.j2"
|
||||||
|
dest: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
|
|
||||||
|
- name: Enables new site
|
||||||
|
when: status.stat.exists == false
|
||||||
|
file:
|
||||||
|
src: "/etc/nginx/sites-available/{{ http_conf }}"
|
||||||
|
dest: "/etc/nginx/sites-enabled/{{ http_conf }}"
|
||||||
|
state: link
|
||||||
|
notify: Reload Nginx
|
||||||
|
|
||||||
|
handlers:
|
||||||
|
- name: Reload Nginx
|
||||||
|
service:
|
||||||
|
name: nginx
|
||||||
|
state: reloaded
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
POSTGRESQL_PASSWORD: "{{ pg_password }}"
|
POSTGRESQL_PASSWORD: "{{ pg_password }}"
|
||||||
POSTGRESQL_DATABASE: 'postgres'
|
POSTGRESQL_DATABASE: 'postgres'
|
||||||
PGDATA: '/var/lib/postgresql/data/pgdata'
|
PGDATA: '/var/lib/postgresql/data/pgdata'
|
||||||
exposed_ports:
|
|
||||||
- 5432
|
|
||||||
published_ports:
|
published_ports:
|
||||||
- 5432:5432
|
- 5432:5432
|
||||||
volumes:
|
volumes:
|
||||||
|
Loading…
Reference in New Issue
Block a user