main.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. - set_fact:
  3. parsed_named_certificates: "{{ named_certificates | lib_utils_oo_parse_named_certificates(named_certs_dir, internal_hostnames) }}"
  4. when: named_certificates | length > 0
  5. delegate_to: localhost
  6. run_once: true
  7. - openshift_facts:
  8. role: master
  9. local_facts:
  10. named_certificates: "{{ parsed_named_certificates | default([]) }}"
  11. additive_facts_to_overwrite:
  12. - "{{ 'master.named_certificates' if overwrite_named_certs | bool else omit }}"
  13. - name: Clear named certificates
  14. file:
  15. path: "{{ named_certs_dir }}"
  16. state: absent
  17. when: overwrite_named_certs | bool
  18. - name: Ensure named certificate directory exists
  19. file:
  20. path: "{{ named_certs_dir }}"
  21. state: directory
  22. mode: 0700
  23. - name: Land named certificates
  24. copy:
  25. src: "{{ item.certfile }}"
  26. dest: "{{ named_certs_dir }}/{{ item.certfile | basename }}"
  27. with_items: "{{ named_certificates }}"
  28. - name: Land named certificate keys
  29. copy:
  30. src: "{{ item.keyfile }}"
  31. dest: "{{ named_certs_dir }}/{{ item.keyfile | basename }}"
  32. mode: 0600
  33. with_items: "{{ named_certificates }}"
  34. - name: Land named CA certificates
  35. copy:
  36. src: "{{ item }}"
  37. dest: "{{ named_certs_dir }}/{{ item | basename }}"
  38. mode: 0600
  39. with_items: "{{ named_certificates | lib_utils_oo_collect('cafile') }}"