main.yml 1004 B

123456789101112131415161718192021222324
  1. ---
  2. - name: Ensure the generated_configs directory present
  3. file:
  4. path: "{{ openshift_generated_configs_dir }}/{{ item.master_cert_subdir }}"
  5. state: directory
  6. mode: 0700
  7. with_items: masters_needing_certs
  8. - file:
  9. src: "{{ openshift_master_ca_cert }}"
  10. dest: "{{ openshift_generated_configs_dir }}/{{ item.master_cert_subdir }}/ca.crt"
  11. with_items: masters_needing_certs
  12. - name: Create the master certificates if they do not already exist
  13. command: >
  14. {{ openshift.common.admin_binary }} create-master-certs
  15. --hostnames={{ item.openshift.common.hostname }},{{ item.openshift.common.public_hostname }}
  16. --master={{ item.openshift.master.api_url }}
  17. --public-master={{ item.openshift.master.public_api_url }}
  18. --cert-dir={{ openshift_generated_configs_dir }}/{{ item.master_cert_subdir }}
  19. --overwrite=false
  20. args:
  21. creates: "{{ openshift_generated_configs_dir }}/{{ item.master_cert_subdir }}/master.server.crt"
  22. with_items: masters_needing_certs