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.

36 lines
1.3 KiB

  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. {%- elif ansible_os_family == "Suse" -%}
  12. /etc/pki/trust/anchors/etcd-ca.pem
  13. {%- elif ansible_os_family == "ClearLinux" -%}
  14. /usr/share/ca-certs/etcd-ca.pem
  15. {%- endif %}
  16. tags:
  17. - facts
  18. - name: Gen_certs | add CA to trusted CA dir
  19. copy:
  20. src: "{{ etcd_cert_dir }}/ca.pem"
  21. dest: "{{ ca_cert_path }}"
  22. remote_src: true
  23. register: etcd_ca_cert
  24. - name: Gen_certs | update ca-certificates (Debian/Ubuntu/SUSE/Container Linux by CoreOS)
  25. command: update-ca-certificates
  26. when: etcd_ca_cert.changed and ansible_os_family in ["Debian", "CoreOS", "Container Linux by CoreOS", "Suse"]
  27. - name: Gen_certs | update ca-certificates (RedHat)
  28. command: update-ca-trust extract
  29. when: etcd_ca_cert.changed and ansible_os_family == "RedHat"
  30. - name: Gen_certs | update ca-certificates (ClearLinux)
  31. command: clrtrust add "{{ ca_cert_path }}"
  32. when: etcd_ca_cert.changed and ansible_os_family == "ClearLinux"