Изменена структура ролей для контейнеров
This commit is contained in:
9
ansible/roles/nginx-web-proxy/defaults/main.yml
Normal file
9
ansible/roles/nginx-web-proxy/defaults/main.yml
Normal file
@ -0,0 +1,9 @@
|
||||
---
|
||||
nginx_proxy_name: ''
|
||||
nginx_proxy_template: ''
|
||||
nginx_proxy_params: {}
|
||||
|
||||
nginx_ssl_type: ~
|
||||
nginx_ssl_name: '{{ nginx_proxy_name }}'
|
||||
nginx_ssl_email: ''
|
||||
nginx_ssl_domains: []
|
20
ansible/roles/nginx-web-proxy/tasks/main.yml
Normal file
20
ansible/roles/nginx-web-proxy/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
- name: "Configure ssl certificate for {{ nginx_proxy_name }}"
|
||||
include_role:
|
||||
name: blocks/ssl-certificate
|
||||
vars:
|
||||
cert_type: '{{ nginx_ssl_type }}'
|
||||
cert_name: '{{ nginx_ssl_name }}'
|
||||
cert_email: '{{ nginx_ssl_email }}'
|
||||
cert_domains: '{{ nginx_ssl_domains }}'
|
||||
when: nginx_ssl_type is not none
|
||||
tags:
|
||||
- webserver
|
||||
|
||||
- name: "Create nginx config for {{ nginx_proxy_name }} from {{ nginx_proxy_template }}."
|
||||
template:
|
||||
src: '{{ nginx_proxy_template }}'
|
||||
dest: "/etc/nginx/sites-enabled/{{ nginx_proxy_name }}.conf"
|
||||
notify: restart nginx
|
||||
tags:
|
||||
- webserver
|
Reference in New Issue
Block a user