provision.yml 1.8 KB

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