import_vault_root_ca/tasks/import.yml
Bertrand Lanson d07b38c913
All checks were successful
test / Linting (push) Successful in 9s
test / Molecule tests (default, debian11) (push) Successful in 43s
test / Molecule tests (default, ubuntu2004) (push) Successful in 48s
test / Molecule tests (default, debian12) (push) Successful in 1m3s
test / Molecule tests (with_custom_ca, debian12) (push) Successful in 47s
test / Molecule tests (with_custom_ca, debian11) (push) Successful in 1m5s
test / Molecule tests (default, ubuntu2204) (push) Successful in 1m11s
test / Molecule tests (with_custom_ca, ubuntu2004) (push) Successful in 1m12s
test / Molecule tests (with_custom_ca, ubuntu2204) (push) Successful in 1m14s
copy to /tmp the temp cert to avoid not triggering ca-cert update
2023-07-02 20:32:30 +02:00

19 lines
726 B
YAML

---
# task/import file for import_vault_root_ca
- name: "Download certificate file"
ansible.builtin.get_url:
url: "{{ item.url }}"
validate_certs: false
force: "{{ import_vault_root_ca_certificate_force_download }}"
dest: "/tmp/{{ item.cert_name }}.tmp"
mode: '0644'
loop: "{{ import_vault_root_ca_certificate_list }}"
- name: "Make sure certificate is in PEM format"
ansible.builtin.command:
cmd: "openssl x509 -in /tmp/{{ item.cert_name }}.tmp -out {{ import_vault_root_ca_cert_dir }}/{{ item.cert_name }}.crt -outform pem"
creates: "{{ import_vault_root_ca_cert_dir }}/{{ item.cert_name }}.crt"
loop: "{{ import_vault_root_ca_certificate_list }}"
notify:
- update-ca-certificates