Merge "Allow to provide conditions for certificates"

This commit is contained in:
Zuul 2021-12-25 11:19:26 +00:00 committed by Gerrit Code Review
commit ff358384af
2 changed files with 7 additions and 4 deletions

View File

@ -45,13 +45,16 @@
src: "{{ item.src }}"
register: _cert_slurp
loop: "{{ pki_install_certificates | default([]) }}"
when: item.condition | default('True')
- name: Create certificate destination directories
file:
path: "{{ item.dest | dirname }}"
path: "{{ install.item.dest | dirname }}"
state: directory
mode: "0755"
loop: "{{ pki_install_certificates | default([]) }}"
loop: "{{ _cert_slurp.results }}"
loop_control:
loop_var: install
- name: Install Server certificates to targets
copy:

View File

@ -24,7 +24,7 @@ pki_ca_defs: |-
{% set _ = _cas.extend(lookup('vars', _ca)) %}
{% endfor %}
{% endif %}
{{ _cas }}
{{ _cas | rejectattr('condition', 'false') }}
# Gather certificate definitions from hostvars
pki_cert_defs: |-
@ -37,4 +37,4 @@ pki_cert_defs: |-
{% set _ = _certs.extend(lookup('vars', _cert)) %}
{% endfor %}
{% endif %}
{{ _certs }}
{{ _certs | rejectattr('condition', 'false') }}