|
1 | 1 | ---
|
2 | 2 |
|
3 |
| -- name: Check if hosts have been installed previously |
4 |
| - hosts: all |
5 |
| - become: yes |
6 |
| - tasks: |
7 |
| - - name: check for installation flag file |
8 |
| - stat: |
9 |
| - path: "/var/lib/POC_INSTALLED" |
10 |
| - register: check_poc_installed |
11 |
| - |
12 |
| - - name: set poc_installed |
13 |
| - set_fact: |
14 |
| - poc_installed: True |
15 |
| - when: check_poc_installed.stat.exists |
16 |
| - |
17 |
| -- name: Collect install flags and populate new_nodes |
18 |
| - hosts: localhost |
19 |
| - tasks: |
20 |
| - - set_fact: |
21 |
| - poc_installed_masters: [] |
22 |
| - |
23 |
| - - name: populate poc_installed_masters |
24 |
| - set_fact: |
25 |
| - poc_installed_masters: "{{ poc_installed_masters + [item] }}" |
26 |
| - when: hostvars[item].poc_installed|default(False)|bool |
27 |
| - with_items: "{{ groups['masters'] }}" |
28 |
| - |
29 |
| - - name: populate new_nodes -group for scaleup |
30 |
| - add_host: |
31 |
| - name: "{{ item }}" |
32 |
| - groups: new_nodes |
33 |
| - when: |
34 |
| - - hostvars[item].poc_installed|default(False)|bool == False |
35 |
| - - allow_openshift_node_scaleup | default(False) | bool |
36 |
| - with_items: "{{ groups['nodes'] }}" |
| 3 | +- include: get_install_state.yml |
37 | 4 |
|
38 | 5 | - include: "{{ os_ansible_path|default('../../openshift-ansible') }}/playbooks/byo/config.yml"
|
39 |
| - when: hostvars['localhost']['poc_installed_masters']|length == 0 |
40 |
| - |
41 |
| -- include: "{{ os_ansible_path|default('../../openshift-ansible') }}/playbooks/byo/openshift-node/scaleup.yml" |
42 | 6 | when:
|
43 |
| - - allow_openshift_node_scaleup | default(False) | bool |
44 |
| - - groups['new_nodes']|default([])|length>0 |
| 7 | + - groups['new_masters']|default([])|length == groups['masters']|default([])|length |
45 | 8 |
|
46 |
| -- name: Set install flags |
47 |
| - hosts: all |
48 |
| - become: yes |
49 |
| - tasks: |
50 |
| - - name: set installation flag |
51 |
| - copy: |
52 |
| - dest: "/var/lib/POC_INSTALLED" |
53 |
| - content: | |
54 |
| - POC installed this host at {{ ansible_date_time['iso8601'] }} |
55 |
| - when: poc_installed | default(False) | bool == False |
| 9 | +- include: set_install_state.yml |
0 commit comments