config.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. ---
  2. - name: Populate oo_masters_to_config host group
  3. hosts: localhost
  4. gather_facts: no
  5. vars_files:
  6. - vars.yml
  7. tasks:
  8. - name: Evaluate oo_masters_to_config
  9. add_host:
  10. name: "{{ item }}"
  11. groups: oo_masters_to_config
  12. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  13. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  14. with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-master"] | default([])
  15. - name: Evaluate oo_nodes_to_config
  16. add_host:
  17. name: "{{ item }}"
  18. groups: oo_nodes_to_config
  19. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  20. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  21. with_items: groups["tag_env-host-type_{{ cluster_id }}-openshift-node"] | default([])
  22. - name: Evaluate oo_first_master
  23. add_host:
  24. name: "{{ groups['tag_env-host-type_' ~ cluster_id ~ '-openshift-master'][0] }}"
  25. groups: oo_first_master
  26. ansible_ssh_user: "{{ deployment_vars[deployment_type].ssh_user }}"
  27. ansible_sudo: "{{ deployment_vars[deployment_type].sudo }}"
  28. when: "'tag_env-host-type_{{ cluster_id }}-openshift-master' in groups"
  29. - include: ../../common/openshift-cluster/config.yml
  30. vars:
  31. openshift_cluster_id: "{{ cluster_id }}"
  32. openshift_debug_level: 4
  33. openshift_deployment_type: "{{ deployment_type }}"
  34. openshift_first_master: "{{ groups.oo_first_master.0 }}"
  35. openshift_hostname: "{{ ec2_private_ip_address }}"
  36. openshift_public_hostname: "{{ ec2_ip_address }}"