You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
977 B

  1. ---
  2. - name: Gen_certs | target ca-certificate store file
  3. set_fact:
  4. ca_cert_path: |-
  5. {% if ansible_os_family == "Debian" -%}
  6. /usr/local/share/ca-certificates/etcd-ca.crt
  7. {%- elif ansible_os_family == "RedHat" -%}
  8. /etc/pki/ca-trust/source/anchors/etcd-ca.crt
  9. {%- elif ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] -%}
  10. /etc/ssl/certs/etcd-ca.pem
  11. {%- endif %}
  12. tags: facts
  13. - name: Gen_certs | add CA to trusted CA dir
  14. copy:
  15. src: "{{ etcd_cert_dir }}/ca.pem"
  16. dest: "{{ ca_cert_path }}"
  17. remote_src: true
  18. register: etcd_ca_cert
  19. - name: Gen_certs | update ca-certificates (Debian/Ubuntu/Container Linux by CoreOS)
  20. command: update-ca-certificates
  21. when: etcd_ca_cert.changed and ansible_os_family in ["Debian", "CoreOS", "Container Linux by CoreOS"]
  22. - name: Gen_certs | update ca-certificates (RedHat)
  23. command: update-ca-trust extract
  24. when: etcd_ca_cert.changed and ansible_os_family == "RedHat"