Skip to content

Commit b1ff938

Browse files
Allow --images-task to be set to none.
This handles the pre-provisioned nodes use-case. Signed-off-by: Luke Short <[email protected]>
1 parent 2e9989f commit b1ff938

File tree

2 files changed

+68
-64
lines changed

2 files changed

+68
-64
lines changed

plugins/tripleo-undercloud/images.yml

+66-64
Original file line numberDiff line numberDiff line change
@@ -87,75 +87,77 @@
8787
dest: "{{ tmp_oc_repos_dir }}"
8888
with_items: "{{ install.get('repos', {}).urls|default([]) }}"
8989

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"
9193

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('')
9698

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
103105

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
111113

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
122124

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
132134

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
142144

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
153155

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

plugins/tripleo-undercloud/plugin.spec

+2
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,12 @@ subparsers:
342342
* rpm - packaged with product (versions 8 and above)
343343
* import - Download pre-built images from a given source (versions 7 and 8). Requires '--images-url'.
344344
* build - build images locally (takes longer) on top of regular cloud guest image. CentOS/RHEL will be used for RDO/OSP.
345+
* none - do not upload any Overcloud images (useful for pre-provisioned nodes)
345346
choices:
346347
- rpm
347348
- import
348349
- build
350+
- none
349351

350352
images-url:
351353
type: Value

0 commit comments

Comments
 (0)