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.

28 lines
983 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:
  13. - facts
  14. - name: Gen_certs | add CA to trusted CA dir
  15. copy:
  16. src: "{{ etcd_cert_dir }}/ca.pem"
  17. dest: "{{ ca_cert_path }}"
  18. remote_src: true
  19. register: etcd_ca_cert
  20. - name: Gen_certs | update ca-certificates (Debian/Ubuntu/Container Linux by CoreOS)
  21. command: update-ca-certificates
  22. when: etcd_ca_cert.changed and ansible_os_family in ["Debian", "CoreOS", "Container Linux by CoreOS"]
  23. - name: Gen_certs | update ca-certificates (RedHat)
  24. command: update-ca-trust extract
  25. when: etcd_ca_cert.changed and ansible_os_family == "RedHat"