Browse Source

draft for the reverse proxy role

This role split the reverse proxy configuration in three files per
host. Every file belong to a different directory that is created on
the reverse proxy we use (nginx).
master
Edoardo Putti 8 years ago
parent
commit
cf365e645d
1 changed files with 33 additions and 6 deletions
  1. +33
    -6
      roles/reverse_proxy/tasks/main.yaml

+ 33
- 6
roles/reverse_proxy/tasks/main.yaml View File

@ -1,9 +1,36 @@
---
# possibili nome macchina
# ansible_nodename
# ansible_hostname
- name: Upload reverse proxy configuration
- name: Create the http.conf directory for nginx
file:
state: directory
dest: "/etc/nginx/http.conf.d"
delegate_to: gandalf2
- name: Upload http to reverse proxy
template:
src: http.j2
dest: "/etc/nginx/http.conf.d/http_{{ hostname }}.conf"
delegate_to: gandalf2
- name: Create the map.conf directory for nginx
file:
state: directory
dest: "/etc/nginx/map.conf.d"
delegate_to: gandalf2
- name: Create the upstream.conf directory for nginx
file:
state: directory
dest: "/etc/nginx/upstream.conf.d"
delegate_to: gandalf2
- name: Upload mappings to reverse proxy
template:
src: reverse_proxy.j2
dest: "/etc/nginx/nginx.conf.d/{{ nome_macchina }}.conf"
src: map.j2
dest: "/etc/nginx/map.conf.d/map_{{ hostname }}.conf"
delegate_to: gandalf2
- name: Upload upstream to reverse proxy
template:
src: upstream.j2
dest: "/etc/nginx/upstream.conf.d/upstream_{{ hostname }}.conf"
delegate_to: gandalf2

Loading…
Cancel
Save