provision.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. ---
  2. - name: Create the OpenStack resources for cluster installation
  3. hosts: localhost
  4. tasks:
  5. - name: retrieve cluster name from the environment if present
  6. set_fact:
  7. openshift_openstack_stack_name: "{{ lookup('env', 'OPENSHIFT_CLUSTER') | ternary (lookup('env', 'OPENSHIFT_CLUSTER'), omit) }}"
  8. - name: provision cluster
  9. import_role:
  10. name: openshift_openstack
  11. tasks_from: provision.yml
  12. # NOTE(shadower): Bring in the host groups:
  13. - name: evaluate groups
  14. import_playbook: ../../init/evaluate_groups.yml
  15. - name: Wait for the nodes and gather their facts
  16. hosts: oo_all_hosts
  17. become: yes
  18. # NOTE: The nodes may not be up yet, don't gather facts here.
  19. # They'll be collected after `wait_for_connection`.
  20. gather_facts: no
  21. tasks:
  22. - name: Wait for the the nodes to come up
  23. wait_for_connection:
  24. - name: Gather facts for the new nodes
  25. setup:
  26. # TODO(shadower): consider splitting this up so people can stop here
  27. # and configure their DNS if they have to.
  28. - name: Populate the DNS entries
  29. hosts: localhost
  30. tasks:
  31. - name: Populate DNS entries
  32. import_role:
  33. name: openshift_openstack
  34. tasks_from: populate-dns.yml
  35. when:
  36. - openshift_openstack_external_nsupdate_keys is defined
  37. - openshift_openstack_external_nsupdate_keys.private is defined or openshift_openstack_external_nsupdate_keys.public is defined
  38. - import_playbook: ../../init/basic_facts.yml
  39. - name: Optionally subscribe the RHEL nodes
  40. hosts: oo_all_hosts
  41. become: yes
  42. gather_facts: yes
  43. tasks:
  44. - name: Subscribe RHEL instances
  45. import_role:
  46. name: rhel_subscribe
  47. when:
  48. - ansible_distribution == "RedHat"
  49. - rhsub_user is defined
  50. - rhsub_pass is defined