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.

30 lines
1.1 KiB

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