main.yml 1.3 KB

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