summaryrefslogtreecommitdiffstats
path: root/playbooks/openstack/openshift-cluster/provision.yml
blob: 44e3d00c00ef03b74925660bd895be4264e1e8f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
- name: Create the OpenStack resources for cluster installation
  hosts: localhost
  tasks:
  - name: provision cluster
    import_role:
      name: openshift_openstack
      tasks_from: provision.yml


# NOTE(shadower): Bring in the host groups:
- name: evaluate groups
  import_playbook: ../../init/evaluate_groups.yml


- name: Wait for the nodes and gather their facts
  hosts: oo_all_hosts
  become: yes
  # NOTE: The nodes may not be up yet, don't gather facts here.
  # They'll be collected after `wait_for_connection`.
  gather_facts: no
  tasks:
  - name: Wait for the the nodes to come up
    wait_for_connection:

  - name: Gather facts for the new nodes
    setup:


# TODO(shadower): consider splitting this up so people can stop here
# and configure their DNS if they have to.
- name: Populate the DNS entries
  hosts: localhost
  tasks:
  - name: Populate DNS entries
    import_role:
      name: openshift_openstack
      tasks_from: populate-dns.yml
    when:
    - openshift_openstack_external_nsupdate_keys is defined
    - openshift_openstack_external_nsupdate_keys.private is defined or openshift_openstack_external_nsupdate_keys.public is defined


- import_playbook: ../../init/basic_facts.yml

- name: Optionally subscribe the RHEL nodes
  hosts: oo_all_hosts
  become: yes
  gather_facts: yes
  tasks:
  - name: Subscribe RHEL instances
    import_role:
      name: rhel_subscribe
    when:
    - ansible_distribution == "RedHat"
    - rhsub_user is defined
    - rhsub_pass is defined

  - name: Enable required YUM repositories
    import_role:
      name: openshift_repos
    when:
    - ansible_distribution == "RedHat"
    - rh_subscribed is defined


- name: Prepare the Nodes in the cluster for installation
  hosts: oo_all_hosts
  become: yes
  gather_facts: yes
  tasks:
  - name: Install dependencies
    import_role:
      name: openshift_openstack
      tasks_from: node-packages.yml

  - name: Configure Node
    import_role:
      name: openshift_openstack
      tasks_from: node-configuration.yml