config.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. - name: "populate oo_hosts_to_config host group if needed"
  2. hosts: localhost
  3. gather_facts: no
  4. tasks:
  5. - name: Evaluate oo_host_group_exp if it's set
  6. add_host: "name={{ item }} groups=oo_hosts_to_config"
  7. with_items: "{{ oo_host_group_exp | default('') }}"
  8. when: oo_host_group_exp is defined
  9. - name: "Gather facts for minions in {{ oo_env }}"
  10. hosts: "tag_env-host-type-{{ oo_env }}-openshift-minion"
  11. connection: ssh
  12. user: root
  13. - name: "Set Origin specific facts on localhost (for later use)"
  14. hosts: localhost
  15. gather_facts: no
  16. tasks:
  17. - name: Setting oo_minion_ips fact on localhost
  18. set_fact:
  19. oo_minion_ips: "{{ hostvars
  20. | oo_select_keys(groups['tag_env-host-type-' + oo_env + '-openshift-minion'])
  21. | oo_collect(attribute='ansible_eth0.ipv4.address') }}"
  22. when: groups['tag_env-host-type-' + oo_env + '-openshift-minion'] is defined
  23. - name: "Configure instances"
  24. hosts: oo_hosts_to_config
  25. connection: ssh
  26. user: root
  27. vars_files:
  28. - vars.yml
  29. roles:
  30. - ../../../roles/base_os
  31. - ../../../roles/repos
  32. - {
  33. role: ../../../roles/openshift_master,
  34. oo_minion_ips: "{{ hostvars['localhost'].oo_minion_ips | default(['']) }}",
  35. oo_bind_ip: "{{ hostvars[inventory_hostname].ansible_eth0.ipv4.address | default(['']) }}"
  36. }
  37. - ../../../roles/pods