extend existing certificate list instead of overwriting it. Ansible realy needs a deep merge...

This commit is contained in:
nd 2020-04-26 11:57:17 +02:00
parent d2ddb8a666
commit 1ddb7fa78d
No known key found for this signature in database
GPG key ID: 21B5CD4DEE3670E9
4 changed files with 10 additions and 5 deletions

View file

@ -1,4 +1,3 @@
nginx: nginx:
add_headers: [] add_headers: []
real_ip_from: real_ip_from:

View file

@ -1,4 +1,3 @@
--- ---
dependencies: dependencies:
- { role: monitoring, when: nginx.monitoring } - { role: monitoring, when: nginx.monitoring }
- certificates

View file

@ -1,4 +1,14 @@
--- ---
- set_fact:
nginx_certs: "{{ nginx.vhosts|nginx_vhosts_to_certificates }}"
inventory_certs: "{{ certificates.certs|d({}) }}"
- include_role:
name: certificates
vars:
certificates:
certs: "{{ {}|combine(nginx_certs, inventory_certs, recursive=True) }}"
- name: install nginx - name: install nginx
apt: pkg=nginx apt: pkg=nginx
notify: notify:

View file

@ -3,6 +3,3 @@ monitoring:
checks: checks:
local: local:
nginx_status: {} nginx_status: {}
certificates:
certs: "{{ nginx.vhosts|nginx_vhosts_to_certificates }}"