|
87 | 87 | dest: "{{ tmp_oc_repos_dir }}"
|
88 | 88 | with_items: "{{ install.get('repos', {}).urls|default([]) }}"
|
89 | 89 |
|
90 |
| - - include_tasks: "tasks/images/{{ install.images.task }}.yml" |
| 90 | + block: |
| 91 | + when: install.images.task != 'none' |
| 92 | + - include_tasks: "tasks/images/{{ install.images.task }}.yml" |
91 | 93 |
|
92 |
| - - name: modify images - update to core build and install packages |
93 |
| - include_tasks: tasks/images/repos.yml |
94 |
| - # update is a func name (dict.update) so it must be used as str explicitly |
95 |
| - when: install.images.packages|default('') or install.images['update'] or install.images.remove|default('') |
| 94 | + - name: modify images - update to core build and install packages |
| 95 | + include_tasks: tasks/images/repos.yml |
| 96 | + # update is a func name (dict.update) so it must be used as str explicitly |
| 97 | + when: install.images.packages|default('') or install.images['update'] or install.images.remove|default('') |
96 | 98 |
|
97 |
| - # Trigger only when update kernel flag is specified and new packages installed inside overcloud image |
98 |
| - - name: update default overcloud kernel form modified overcloud image |
99 |
| - include_tasks: tasks/images/update-kernel.yml |
100 |
| - when: |
101 |
| - - install['overcloud']['update']['kernel'] |
102 |
| - - install.images.packages |
| 99 | + # Trigger only when update kernel flag is specified and new packages installed inside overcloud image |
| 100 | + - name: update default overcloud kernel form modified overcloud image |
| 101 | + include_tasks: tasks/images/update-kernel.yml |
| 102 | + when: |
| 103 | + - install['overcloud']['update']['kernel'] |
| 104 | + - install.images.packages |
103 | 105 |
|
104 |
| - #Need to fix BZ1462703 to apply --os-cloud |
105 |
| - - name: upload the overcloud images to glance |
106 |
| - shell: | |
107 |
| - set -exuo pipefail |
108 |
| - source ~/stackrc |
109 |
| - openstack overcloud image upload --update-existing |
110 |
| - tags: skip_ansible_lint |
| 106 | + #Need to fix BZ1462703 to apply --os-cloud |
| 107 | + - name: upload the overcloud images to glance |
| 108 | + shell: | |
| 109 | + set -exuo pipefail |
| 110 | + source ~/stackrc |
| 111 | + openstack overcloud image upload --update-existing |
| 112 | + tags: skip_ansible_lint |
111 | 113 |
|
112 |
| - - name: check for existing nodes ( OS <= 10 ) |
113 |
| - shell: | |
114 |
| - set -exuo pipefail |
115 |
| - source ~/stackrc |
116 |
| - ironic node-list 2>/dev/null | wc -l |
117 |
| - tags: |
118 |
| - - skip_ansible_lint |
119 |
| - register: oc_nodes_prev |
120 |
| - when: |
121 |
| - - undercloud_version|openstack_release <= 10 |
| 114 | + - name: check for existing nodes ( OS <= 10 ) |
| 115 | + shell: | |
| 116 | + set -exuo pipefail |
| 117 | + source ~/stackrc |
| 118 | + ironic node-list 2>/dev/null | wc -l |
| 119 | + tags: |
| 120 | + - skip_ansible_lint |
| 121 | + register: oc_nodes_prev |
| 122 | + when: |
| 123 | + - undercloud_version|openstack_release <= 10 |
122 | 124 |
|
123 |
| - - name: check for existing nodes ( OS >= 11 ) |
124 |
| - shell: | |
125 |
| - source ~/stackrc |
126 |
| - openstack baremetal node list -c UUID -f json |
127 |
| - tags: |
128 |
| - - skip_ansible_lint |
129 |
| - register: oc_nodes |
130 |
| - when: |
131 |
| - - undercloud_version|openstack_release >= 11 |
| 125 | + - name: check for existing nodes ( OS >= 11 ) |
| 126 | + shell: | |
| 127 | + source ~/stackrc |
| 128 | + openstack baremetal node list -c UUID -f json |
| 129 | + tags: |
| 130 | + - skip_ansible_lint |
| 131 | + register: oc_nodes |
| 132 | + when: |
| 133 | + - undercloud_version|openstack_release >= 11 |
132 | 134 |
|
133 |
| - - name: configure nodes to use updated kernel and ramdisk ( OS <= 10 ) |
134 |
| - shell: | |
135 |
| - source ~/stackrc |
136 |
| - openstack baremetal configure boot |
137 |
| - tags: |
138 |
| - - skip_ansible_lint |
139 |
| - when: |
140 |
| - - undercloud_version|openstack_release <= 10 |
141 |
| - - oc_nodes_prev.stdout|int > 4 |
| 135 | + - name: configure nodes to use updated kernel and ramdisk ( OS <= 10 ) |
| 136 | + shell: | |
| 137 | + source ~/stackrc |
| 138 | + openstack baremetal configure boot |
| 139 | + tags: |
| 140 | + - skip_ansible_lint |
| 141 | + when: |
| 142 | + - undercloud_version|openstack_release <= 10 |
| 143 | + - oc_nodes_prev.stdout|int > 4 |
142 | 144 |
|
143 |
| - # https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/11/html/upgrading_red_hat_openstack_platform/chap-director-minor-update#sect-Updating_Overcloud_and_Introspection_Images |
144 |
| - - name: configure nodes to use updated kernel and ramdisk ( OS >= 11 ) |
145 |
| - shell: | |
146 |
| - source ~/stackrc |
147 |
| - openstack overcloud node configure {{ ' '.join(oc_nodes.stdout|from_json|map(attribute='UUID')) }} |
148 |
| - tags: |
149 |
| - - skip_ansible_lint |
150 |
| - when: |
151 |
| - - undercloud_version|openstack_release >= 11 |
152 |
| - - oc_nodes.stdout|from_json |
| 145 | + # https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/11/html/upgrading_red_hat_openstack_platform/chap-director-minor-update#sect-Updating_Overcloud_and_Introspection_Images |
| 146 | + - name: configure nodes to use updated kernel and ramdisk ( OS >= 11 ) |
| 147 | + shell: | |
| 148 | + source ~/stackrc |
| 149 | + openstack overcloud node configure {{ ' '.join(oc_nodes.stdout|from_json|map(attribute='UUID')) }} |
| 150 | + tags: |
| 151 | + - skip_ansible_lint |
| 152 | + when: |
| 153 | + - undercloud_version|openstack_release >= 11 |
| 154 | + - oc_nodes.stdout|from_json |
153 | 155 |
|
154 |
| - - name: remove downloaded images |
155 |
| - file: |
156 |
| - path: "/home/{{ install.user.name }}/{{ item[1] }}" |
157 |
| - state: absent |
158 |
| - with_subelements: |
159 |
| - - "{{ (image_files|default({})).get('results',{}) }}" |
160 |
| - - "files" |
161 |
| - when: image_files is defined and install.images.cleanup |
| 156 | + - name: remove downloaded images |
| 157 | + file: |
| 158 | + path: "/home/{{ install.user.name }}/{{ item[1] }}" |
| 159 | + state: absent |
| 160 | + with_subelements: |
| 161 | + - "{{ (image_files|default({})).get('results',{}) }}" |
| 162 | + - "files" |
| 163 | + when: image_files is defined and install.images.cleanup |
0 commit comments