Update to 2022-09-13 17:00

This commit is contained in:
Daniel Berteaud
2022-09-13 17:00:08 +02:00
parent 3d8b59673b
commit a612a2fdcd
18 changed files with 89 additions and 182 deletions

View File

@@ -100,26 +100,14 @@
when: consul_vault_secrets.pki.enabled or consul_vault_secrets.tokens.enabled
tags: consul
- name: Deploy consul-template agent cert template
template: src=agent_cert.tpl.j2 dest={{ consul_root_dir }}/consul-template/{{ item.where }} owner=root group=root
loop:
- what: certificate
where: agent.crt.tpl
- what: private_key
where: agent.key.tpl
- what: issuing_ca
where: ca.crt.tpl
- name: Deploy agent bundle template
template: src=agent_bundle.pem.tpl.j2 dest={{ consul_root_dir }}/consul-template/agent_bundle.pem.tpl owner=root group=root
notify: restart consul-template-consul
when: consul_vault_secrets.pki.enabled
tags: consul
- name: Deploy consul-template cli cert template
template: src=cli_cert.tpl.j2 dest={{ consul_root_dir }}/consul-template/{{ item.where }} owner=root group=root
loop:
- what: certificate
where: cli.crt.tpl
- what: private_key
where: cli.key.tpl
- name: Deploy consul-template cli bundle template
template: src=cli_bundle.pem.tpl.j2 dest={{ consul_root_dir }}/consul-template/cli_bundle.pem.tpl owner=root group=root
notify: restart consul-template-consul
when: consul_vault_secrets.pki.enabled and consul_conf.server
tags: consul
@@ -132,10 +120,11 @@
- name: Set ACL on the TLS dir
shell: |
setfacl -R -b -x {{ consul_root_dir }}/tls
setfacl -R -b -k {{ consul_root_dir }}/tls
{% if consul_admin_groups | length > 0 %}
setfacl -R -m {% for group in consul_admin_groups %}g:{{ group }}:rX{{ ',' if not loop.last }}{% endfor %} {{ consul_root_dir }}/tls
setfacl -R -m {% for group in consul_admin_groups %}d:g:{{ group }}:rX{{ ',' if not loop.last }}{% endfor %} {{ consul_root_dir }}/tls
setfacl -m {% for group in consul_admin_groups %}g:{{ group }}:rx{{ ',' if not loop.last }}{% endfor %} {{ consul_root_dir }}/tls
setfacl -m {% for group in consul_admin_groups %}d:g:{{ group }}:r{{ ',' if not loop.last }}{% endfor %} {{ consul_root_dir }}/tls
setfacl -m {% for group in consul_admin_groups %}g:{{ group }}:r{{ ',' if not loop.last }}{% endfor %} {{ consul_root_dir }}/tls/*
{% endif %}
changed_when: False
failed_when: False # Do not fail if eg, the FS doesn't support ACL