config.yml 1.4 KB

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