|
|
@ -2,14 +2,13 @@
|
|
|
|
- name: Install NGINX
|
|
|
|
- name: Install NGINX
|
|
|
|
apt:
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
update_cache: true
|
|
|
|
name: "{{ item }}"
|
|
|
|
name:
|
|
|
|
|
|
|
|
- nginx
|
|
|
|
|
|
|
|
- 'python3-cryptography'
|
|
|
|
state: latest
|
|
|
|
state: latest
|
|
|
|
register: apt_result
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
until: apt_result is succeeded
|
|
|
|
loop:
|
|
|
|
|
|
|
|
- nginx
|
|
|
|
|
|
|
|
- "python3-cryptography"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: Copy snippets
|
|
|
|
- name: Copy snippets
|
|
|
|
template:
|
|
|
|
template:
|
|
|
@ -62,6 +61,7 @@
|
|
|
|
template:
|
|
|
|
template:
|
|
|
|
src: nginx.conf
|
|
|
|
src: nginx.conf
|
|
|
|
dest: /etc/nginx/nginx.conf
|
|
|
|
dest: /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
notify: Reload nginx
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: << Manage reverse proxy >>
|
|
|
|
# TODO: << Manage reverse proxy >>
|
|
|
|
- name: Create the SSL reverse proxy conf
|
|
|
|
- name: Create the SSL reverse proxy conf
|
|
|
@ -71,11 +71,12 @@
|
|
|
|
force: no
|
|
|
|
force: no
|
|
|
|
|
|
|
|
|
|
|
|
# Manage each http site
|
|
|
|
# Manage each http site
|
|
|
|
- name: Copy reverse proxy sites
|
|
|
|
- name: Copy Http Servers
|
|
|
|
template:
|
|
|
|
template:
|
|
|
|
src: http_server.j2
|
|
|
|
src: http_server.j2
|
|
|
|
dest: "/etc/nginx/sites-available/{{ item.key }}"
|
|
|
|
dest: "/etc/nginx/sites-available/{{ item.key }}"
|
|
|
|
loop: "{{ http_sites | dict2items}}"
|
|
|
|
loop: "{{ http_sites | dict2items}}"
|
|
|
|
|
|
|
|
notify: Reload nginx
|
|
|
|
|
|
|
|
|
|
|
|
- name: Use the dummy certificate
|
|
|
|
- name: Use the dummy certificate
|
|
|
|
file:
|
|
|
|
file:
|
|
|
@ -100,3 +101,4 @@
|
|
|
|
state: link
|
|
|
|
state: link
|
|
|
|
force: yes
|
|
|
|
force: yes
|
|
|
|
loop: "{{ http_sites | dict2items}}"
|
|
|
|
loop: "{{ http_sites | dict2items}}"
|
|
|
|
|
|
|
|
notify: Reload nginx
|
|
|
|