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
978 B

  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. {%- endif %}
  12. tags:
  13. - facts
  14. - name: Gen_certs | add CA to trusted CA dir
  15. copy:
  16. src: "{{ kube_cert_dir }}/ca.pem"
  17. dest: "{{ ca_cert_path }}"
  18. remote_src: true
  19. register: kube_ca_cert
  20. - name: Gen_certs | update ca-certificates (Debian/Ubuntu/Container Linux by CoreOS)
  21. command: update-ca-certificates
  22. when: kube_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: kube_ca_cert.changed and ansible_os_family == "RedHat"