diff --git a/roles/nginx/proxy/defaults/main.yml b/roles/nginx/proxy/defaults/main.yml index 85db434..96d9600 100644 --- a/roles/nginx/proxy/defaults/main.yml +++ b/roles/nginx/proxy/defaults/main.yml @@ -1,5 +1,4 @@ --- # domain: example.com -# backend: 12345 or /example.socket -type: port # port / socket +# backend_port: 12345 OR backend_socket: /example.socket diff --git a/roles/nginx/proxy/meta/main.yml b/roles/nginx/proxy/meta/main.yml index cf70374..7719b0b 100644 --- a/roles/nginx/proxy/meta/main.yml +++ b/roles/nginx/proxy/meta/main.yml @@ -4,5 +4,4 @@ allow_duplicates: yes dependencies: - role: acme/certificate - - role: "nginx/{{ type }}_upstream" - backend: "{{ backend }}" + - role: nginx/upstream diff --git a/roles/nginx/proxy/tasks/main.yml b/roles/nginx/proxy/tasks/main.yml index 7396543..2244741 100644 --- a/roles/nginx/proxy/tasks/main.yml +++ b/roles/nginx/proxy/tasks/main.yml @@ -1,6 +1,6 @@ --- -- name: Configure proxy for {{ domain }} to {{ type }} {{ backend }} +- name: Configure proxy for {{ domain }} to {{ backend_port is defined | ternary(backend_port, backend_socket) }} template: src: proxy.conf dest: "{{ nginx_sites_directory }}/{{ domain }}"