summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Goddard <mark@stackhpc.com>2018-08-29 11:15:55 +0100
committerMark Goddard <mark@stackhpc.com>2018-10-02 13:30:11 +0100
commitef848907981974e83f0f2d8f798ad04cededd508 (patch)
tree1dad1550e437d8d77a83be34ec145c80e80258e0
parentf479413b5e185fe345cb05a38a84baa2815a7981 (diff)
Fix IPA image download
The IPA ramdisk and kernel images may be built or downloaded via a URL. If the latter option is used, any images previously downloaded to $KOLLA_CONFIG_PATH/config/ironic/ironic-agent.* would previously not be updated if the image contents change. This change introduces variables for setting a URL to a file containing checksums for the images. The algorithm used to compute the checksum is also configurable (default sha256). This allows us to ensure we are using the correct version of the image, while avoiding an expensive few hundred megabyte image download just to check. If a checksum is not specified, the image will be downloaded every time to ensure that it is up to date. Change-Id: I8120518ed98d61f3652f5205ce7ec9f798ab2aa1 Story: 2001660 Task: 6693
Notes
Notes (review): Code-Review+2: Will Szumski <will@stackhpc.com> Code-Review+2: Nick Jones <nick@stackhpc.com> Workflow+1: Nick Jones <nick@stackhpc.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Mon, 08 Oct 2018 15:37:29 +0000 Reviewed-on: https://review.openstack.org/597461 Project: openstack/kayobe Branch: refs/heads/master
-rw-r--r--ansible/group_vars/all/bifrost12
-rw-r--r--ansible/group_vars/all/inspector12
-rw-r--r--ansible/group_vars/all/ipa12
-rw-r--r--ansible/kolla-openstack.yml4
-rw-r--r--ansible/overcloud-ipa-images.yml4
-rw-r--r--ansible/roles/image-download/defaults/main.yml19
-rw-r--r--ansible/roles/image-download/tasks/main.yml42
-rw-r--r--ansible/roles/ipa-images/defaults/main.yml12
-rw-r--r--ansible/roles/ipa-images/tasks/main.yml26
-rw-r--r--ansible/roles/kolla-bifrost/defaults/main.yml12
-rw-r--r--ansible/roles/kolla-bifrost/templates/bifrost.yml.j220
-rw-r--r--ansible/roles/kolla-openstack/defaults/main.yml16
-rw-r--r--ansible/roles/kolla-openstack/tasks/config.yml44
-rw-r--r--doc/source/upgrading.rst14
-rw-r--r--etc/kayobe/bifrost.yml21
-rw-r--r--etc/kayobe/inspector.yml12
-rw-r--r--etc/kayobe/ipa.yml12
-rw-r--r--releasenotes/notes/fix-ipa-image-download-3f90f0f40d0feafd.yaml36
18 files changed, 296 insertions, 34 deletions
diff --git a/ansible/group_vars/all/bifrost b/ansible/group_vars/all/bifrost
index fe947dc..4aef1e3 100644
--- a/ansible/group_vars/all/bifrost
+++ b/ansible/group_vars/all/bifrost
@@ -79,9 +79,21 @@ kolla_bifrost_inspector_deploy_ramdisk: "http://{{ provision_oc_net_name | net_i
79# URL of Ironic Python Agent (IPA) kernel image. 79# URL of Ironic Python Agent (IPA) kernel image.
80kolla_bifrost_ipa_kernel_upstream_url: "{{ inspector_ipa_kernel_upstream_url }}" 80kolla_bifrost_ipa_kernel_upstream_url: "{{ inspector_ipa_kernel_upstream_url }}"
81 81
82# URL of checksum of Ironic Python Agent (IPA) kernel image.
83kolla_bifrost_ipa_kernel_checksum_url: "{{ inspector_ipa_kernel_checksum_url }}"
84
85# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
86kolla_bifrost_ipa_kernel_checksum_algorithm: "{{ inspector_ipa_kernel_checksum_algorithm }}"
87
82# URL of Ironic Python Agent (IPA) ramdisk image. 88# URL of Ironic Python Agent (IPA) ramdisk image.
83kolla_bifrost_ipa_ramdisk_upstream_url: "{{ inspector_ipa_ramdisk_upstream_url }}" 89kolla_bifrost_ipa_ramdisk_upstream_url: "{{ inspector_ipa_ramdisk_upstream_url }}"
84 90
91# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
92kolla_bifrost_ipa_ramdisk_checksum_url: "{{ inspector_ipa_ramdisk_checksum_url }}"
93
94# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
95kolla_bifrost_ipa_ramdisk_checksum_algorithm: "{{ inspector_ipa_ramdisk_checksum_algorithm }}"
96
85############################################################################### 97###############################################################################
86# Inventory configuration. 98# Inventory configuration.
87 99
diff --git a/ansible/group_vars/all/inspector b/ansible/group_vars/all/inspector
index 422f597..1f7d4f5 100644
--- a/ansible/group_vars/all/inspector
+++ b/ansible/group_vars/all/inspector
@@ -8,9 +8,21 @@ inspector_extra_kernel_options: "{{ ipa_kernel_options }}"
8# URL of Ironic Python Agent (IPA) kernel image. 8# URL of Ironic Python Agent (IPA) kernel image.
9inspector_ipa_kernel_upstream_url: "{{ ipa_kernel_upstream_url }}" 9inspector_ipa_kernel_upstream_url: "{{ ipa_kernel_upstream_url }}"
10 10
11# URL of checksum of Ironic Python Agent (IPA) kernel image.
12inspector_ipa_kernel_checksum_url: "{{ ipa_kernel_checksum_url }}"
13
14# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
15inspector_ipa_kernel_checksum_algorithm: "{{ ipa_kernel_checksum_algorithm }}"
16
11# URL of Ironic Python Agent (IPA) ramdisk image. 17# URL of Ironic Python Agent (IPA) ramdisk image.
12inspector_ipa_ramdisk_upstream_url: "{{ ipa_ramdisk_upstream_url }}" 18inspector_ipa_ramdisk_upstream_url: "{{ ipa_ramdisk_upstream_url }}"
13 19
20# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
21inspector_ipa_ramdisk_checksum_url: "{{ ipa_ramdisk_checksum_url }}"
22
23# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
24inspector_ipa_ramdisk_checksum_algorithm: "{{ ipa_ramdisk_checksum_algorithm }}"
25
14############################################################################### 26###############################################################################
15# Ironic inspector processing configuration. 27# Ironic inspector processing configuration.
16 28
diff --git a/ansible/group_vars/all/ipa b/ansible/group_vars/all/ipa
index 3742ae4..350d2a6 100644
--- a/ansible/group_vars/all/ipa
+++ b/ansible/group_vars/all/ipa
@@ -65,12 +65,24 @@ ipa_images_kernel_name: "ipa.vmlinuz"
65# URL of Ironic deployment kernel image to download. 65# URL of Ironic deployment kernel image to download.
66ipa_kernel_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe-stable-queens.vmlinuz" 66ipa_kernel_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe-stable-queens.vmlinuz"
67 67
68# URL of checksum of Ironic deployment kernel image.
69ipa_kernel_checksum_url: "{{ ipa_kernel_upstream_url }}.{{ ipa_kernel_checksum_algorithm }}"
70
71# Algorithm of checksum of Ironic deployment kernel image.
72ipa_kernel_checksum_algorithm: "sha256"
73
68# Name of Ironic deployment ramdisk image to register in Glance. 74# Name of Ironic deployment ramdisk image to register in Glance.
69ipa_images_ramdisk_name: "ipa.initramfs" 75ipa_images_ramdisk_name: "ipa.initramfs"
70 76
71# URL of Ironic deployment ramdisk image to download. 77# URL of Ironic deployment ramdisk image to download.
72ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem-stable-queens.cpio.gz" 78ipa_ramdisk_upstream_url: "https://tarballs.openstack.org/ironic-python-agent/coreos/files/coreos_production_pxe_image-oem-stable-queens.cpio.gz"
73 79
80# URL of checksum of Ironic deployment ramdisk image.
81ipa_ramdisk_checksum_url: "{{ ipa_ramdisk_upstream_url }}.{{ ipa_ramdisk_checksum_algorithm }}"
82
83# Algorithm of checksum of Ironic deployment ramdisk image.
84ipa_ramdisk_checksum_algorithm: "sha256"
85
74############################################################################### 86###############################################################################
75# Ironic Python Agent (IPA) deployment configuration. 87# Ironic Python Agent (IPA) deployment configuration.
76 88
diff --git a/ansible/kolla-openstack.yml b/ansible/kolla-openstack.yml
index 5761d8b..be6f865 100644
--- a/ansible/kolla-openstack.yml
+++ b/ansible/kolla-openstack.yml
@@ -171,7 +171,11 @@
171 - name: Set facts containing IPA kernel and ramdisk URLs 171 - name: Set facts containing IPA kernel and ramdisk URLs
172 set_fact: 172 set_fact:
173 kolla_inspector_ipa_kernel_upstream_url: "{{ inspector_ipa_kernel_upstream_url }}" 173 kolla_inspector_ipa_kernel_upstream_url: "{{ inspector_ipa_kernel_upstream_url }}"
174 kolla_inspector_ipa_kernel_checksum_url: "{{ inspector_ipa_kernel_checksum_url }}"
175 kolla_inspector_ipa_kernel_checksum_algorithm: "{{ inspector_ipa_kernel_checksum_algorithm }}"
174 kolla_inspector_ipa_ramdisk_upstream_url: "{{ inspector_ipa_ramdisk_upstream_url }}" 176 kolla_inspector_ipa_ramdisk_upstream_url: "{{ inspector_ipa_ramdisk_upstream_url }}"
177 kolla_inspector_ipa_ramdisk_checksum_url: "{{ inspector_ipa_ramdisk_checksum_url }}"
178 kolla_inspector_ipa_ramdisk_checksum_algorithm: "{{ inspector_ipa_ramdisk_checksum_algorithm }}"
175 when: not ipa_build_images | bool 179 when: not ipa_build_images | bool
176 180
177 - name: Set facts containing IPA kernel and ramdisk paths 181 - name: Set facts containing IPA kernel and ramdisk paths
diff --git a/ansible/overcloud-ipa-images.yml b/ansible/overcloud-ipa-images.yml
index 70f626d..35c6483 100644
--- a/ansible/overcloud-ipa-images.yml
+++ b/ansible/overcloud-ipa-images.yml
@@ -58,7 +58,11 @@
58 set_fact: 58 set_fact:
59 # Don't pass the kernel and ramdisk image URLs if using built images. 59 # Don't pass the kernel and ramdisk image URLs if using built images.
60 ipa_images_kernel_url: "{{ ipa_kernel_upstream_url }}" 60 ipa_images_kernel_url: "{{ ipa_kernel_upstream_url }}"
61 ipa_images_kernel_checksum_url: "{{ ipa_kernel_checksum_url }}"
62 ipa_images_kernel_checksum_algorithm: "{{ ipa_kernel_checksum_algorithm }}"
61 ipa_images_ramdisk_url: "{{ ipa_ramdisk_upstream_url }}" 63 ipa_images_ramdisk_url: "{{ ipa_ramdisk_upstream_url }}"
64 ipa_images_ramdisk_checksum_url: "{{ ipa_ramdisk_checksum_url }}"
65 ipa_images_ramdisk_checksum_algorithm: "{{ ipa_ramdisk_checksum_algorithm }}"
62 when: not ipa_build_images | bool 66 when: not ipa_build_images | bool
63 67
64 - name: Check whether the image cache directory exists 68 - name: Check whether the image cache directory exists
diff --git a/ansible/roles/image-download/defaults/main.yml b/ansible/roles/image-download/defaults/main.yml
new file mode 100644
index 0000000..045c0be
--- /dev/null
+++ b/ansible/roles/image-download/defaults/main.yml
@@ -0,0 +1,19 @@
1---
2# URL of the image.
3# Mutually exclusive with image_download_path.
4image_download_url:
5
6# URL of a checksum of the image.
7# Mutually exclusive with image_download_path.
8image_download_checksum_url:
9
10# Algorithm of a checksum of the image.
11# Mutually exclusive with image_download_path.
12image_download_checksum_algorithm:
13
14# Path to a local file containing the image.
15# Mutually exclusive with image_download_url.
16image_download_path:
17
18# Path to the image's destination.
19image_download_dest:
diff --git a/ansible/roles/image-download/tasks/main.yml b/ansible/roles/image-download/tasks/main.yml
new file mode 100644
index 0000000..c82345b
--- /dev/null
+++ b/ansible/roles/image-download/tasks/main.yml
@@ -0,0 +1,42 @@
1---
2- block:
3 - block:
4 - name: Fail if the checksum algorithm is not set
5 fail:
6 msg: "Checksum algorithm for image {{ image_download_url }} not set"
7 when: image_download_checksum_algorithm is none or
8 image_download_checksum_algorithm == ""
9
10 - name: Get the expected checksum
11 uri:
12 url: "{{ image_download_checksum_url }}"
13 return_content: true
14 register: expected_checksum
15 when:
16 - image_download_checksum_url is not none
17 - image_download_checksum_url != ""
18
19 - name: Ensure the image is downloaded
20 vars:
21 checksum: "{{ image_download_checksum_algorithm }}:{{ expected_checksum.content.split(' ')[0] }}"
22 get_url:
23 url: "{{ image_download_url }}"
24 dest: "{{ image_download_dest }}"
25 mode: 0640
26 # If the file exists locally, its checksum will be compared with this.
27 checksum: "{{ checksum if expected_checksum is not skipped else omit }}"
28 # Always download the image if we have no checksum to compare with.
29 force: "{{ expected_checksum is skipped }}"
30 backup: true
31 when:
32 - image_download_url is not none
33 - image_download_url != ""
34
35- name: Ensure the local image is copied
36 copy:
37 src: "{{ image_download_path }}"
38 dest: "{{ image_download_dest }}"
39 mode: 0640
40 when:
41 - image_download_path is not none
42 - image_download_path != ""
diff --git a/ansible/roles/ipa-images/defaults/main.yml b/ansible/roles/ipa-images/defaults/main.yml
index e266d0e..72a9d89 100644
--- a/ansible/roles/ipa-images/defaults/main.yml
+++ b/ansible/roles/ipa-images/defaults/main.yml
@@ -24,6 +24,12 @@ ipa_images_kernel_name:
24# image in ipa_images_cache_path will be used. 24# image in ipa_images_cache_path will be used.
25ipa_images_kernel_url: 25ipa_images_kernel_url:
26 26
27# URL of checksum of Ironic deployment kernel image.
28ipa_images_kernel_checksum_url:
29
30# Algorithm of checksum of Ironic deployment kernel image.
31ipa_images_kernel_checksum_algorithm:
32
27# Name of Ironic deployment ramdisk image to register in Glance. 33# Name of Ironic deployment ramdisk image to register in Glance.
28ipa_images_ramdisk_name: 34ipa_images_ramdisk_name:
29 35
@@ -31,6 +37,12 @@ ipa_images_ramdisk_name:
31# image in ipa_images_cache_path will be used. 37# image in ipa_images_cache_path will be used.
32ipa_images_ramdisk_url: 38ipa_images_ramdisk_url:
33 39
40# URL of checksum of Ironic deployment ramdisk image.
41ipa_images_ramdisk_checksum_url:
42
43# Algorithm of checksum of Ironic deployment ramdisk image.
44ipa_images_ramdisk_checksum_algorithm:
45
34# Ansible host pattern for limiting which nodes are updated with deploy_ramdisk 46# Ansible host pattern for limiting which nodes are updated with deploy_ramdisk
35# and deploy_kernel properties 47# and deploy_kernel properties
36ipa_images_compute_node_limit: baremetal-compute 48ipa_images_compute_node_limit: baremetal-compute
diff --git a/ansible/roles/ipa-images/tasks/main.yml b/ansible/roles/ipa-images/tasks/main.yml
index a229532..fe2e9f8 100644
--- a/ansible/roles/ipa-images/tasks/main.yml
+++ b/ansible/roles/ipa-images/tasks/main.yml
@@ -7,18 +7,26 @@
7 group: "{{ ansible_user_gid }}" 7 group: "{{ ansible_user_gid }}"
8 become: True 8 become: True
9 9
10- name: Ensure Ironic Python Agent (IPA) images are downloaded 10- name: Ensure Ironic Python Agent (IPA) images are present
11 get_url: 11 vars:
12 url: "{{ item.url }}" 12 image_download_url: "{{ item.url }}"
13 dest: "{{ ipa_images_cache_path }}/{{ item.filename }}" 13 image_download_checksum_url: "{{ item.checksum_url }}"
14 force: true 14 image_download_checksum_algorithm: "{{ item.checksum_algorithm }}"
15 backup: true 15 image_download_dest: "{{ item.dest }}"
16 include_role:
17 name: image-download
16 with_items: 18 with_items:
17 - url: "{{ ipa_images_kernel_url }}" 19 - url: "{{ ipa_images_kernel_url }}"
18 filename: "{{ ipa_images_kernel_name }}" 20 checksum_url: "{{ ipa_images_kernel_checksum_url }}"
21 checksum_algorithm: "{{ ipa_images_kernel_checksum_algorithm }}"
22 dest: "{{ ipa_images_cache_path }}/{{ ipa_images_kernel_name }}"
19 - url: "{{ ipa_images_ramdisk_url }}" 23 - url: "{{ ipa_images_ramdisk_url }}"
20 filename: "{{ ipa_images_ramdisk_name }}" 24 checksum_url: "{{ ipa_images_ramdisk_checksum_url }}"
21 when: item.url != None 25 checksum_algorithm: "{{ ipa_images_ramdisk_checksum_algorithm }}"
26 dest: "{{ ipa_images_cache_path }}/{{ ipa_images_ramdisk_name }}"
27 when: item.url is not none
28 loop_control:
29 label: "{{ item.dest }}"
22 30
23- name: Compute the MD5 checksum of the Ironic Python Agent (IPA) images 31- name: Compute the MD5 checksum of the Ironic Python Agent (IPA) images
24 stat: 32 stat:
diff --git a/ansible/roles/kolla-bifrost/defaults/main.yml b/ansible/roles/kolla-bifrost/defaults/main.yml
index f1e34e5..bdb78ae 100644
--- a/ansible/roles/kolla-bifrost/defaults/main.yml
+++ b/ansible/roles/kolla-bifrost/defaults/main.yml
@@ -58,9 +58,21 @@ kolla_bifrost_download_ipa: true
58# URL of Ironic Python Agent (IPA) kernel image. 58# URL of Ironic Python Agent (IPA) kernel image.
59kolla_bifrost_ipa_kernel_upstream_url: 59kolla_bifrost_ipa_kernel_upstream_url:
60 60
61# URL of checksum of Ironic Python Agent (IPA) kernel image.
62kolla_bifrost_ipa_kernel_checksum_url:
63
64# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
65kolla_bifrost_ipa_kernel_checksum_algorithm:
66
61# URL of Ironic Python Agent (IPA) ramdisk image. 67# URL of Ironic Python Agent (IPA) ramdisk image.
62kolla_bifrost_ipa_ramdisk_upstream_url: 68kolla_bifrost_ipa_ramdisk_upstream_url:
63 69
70# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
71kolla_bifrost_ipa_ramdisk_checksum_url:
72
73# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
74kolla_bifrost_ipa_ramdisk_checksum_algorithm:
75
64# Server inventory to be configured in {{ kolla_node_custom_config_path }}/bifrost/servers.yml. 76# Server inventory to be configured in {{ kolla_node_custom_config_path }}/bifrost/servers.yml.
65kolla_bifrost_servers: {} 77kolla_bifrost_servers: {}
66 78
diff --git a/ansible/roles/kolla-bifrost/templates/bifrost.yml.j2 b/ansible/roles/kolla-bifrost/templates/bifrost.yml.j2
index aa25319..020de20 100644
--- a/ansible/roles/kolla-bifrost/templates/bifrost.yml.j2
+++ b/ansible/roles/kolla-bifrost/templates/bifrost.yml.j2
@@ -51,11 +51,31 @@ download_ipa: "{{ kolla_bifrost_download_ipa }}"
51ipa_kernel_upstream_url: "{{ kolla_bifrost_ipa_kernel_upstream_url }}" 51ipa_kernel_upstream_url: "{{ kolla_bifrost_ipa_kernel_upstream_url }}"
52{% endif %} 52{% endif %}
53 53
54{% if kolla_bifrost_ipa_kernel_checksum_url %}
55# URL of checksum of Ironic Python Agent (IPA) kernel image.
56ipa_kernel_upstream_checksum_url: "{{ kolla_bifrost_ipa_kernel_checksum_url }}"
57{% endif %}
58
59{% if kolla_bifrost_ipa_kernel_checksum_algorithm %}
60# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
61ipa_kernel_upstream_checksum_algo: "{{ kolla_bifrost_ipa_kernel_checksum_algorithm }}"
62{% endif %}
63
54{% if kolla_bifrost_ipa_ramdisk_upstream_url %} 64{% if kolla_bifrost_ipa_ramdisk_upstream_url %}
55# URL of Ironic Python Agent (IPA) ramdisk image. 65# URL of Ironic Python Agent (IPA) ramdisk image.
56ipa_ramdisk_upstream_url: "{{ kolla_bifrost_ipa_ramdisk_upstream_url }}" 66ipa_ramdisk_upstream_url: "{{ kolla_bifrost_ipa_ramdisk_upstream_url }}"
57{% endif %} 67{% endif %}
58 68
69{% if kolla_bifrost_ipa_ramdisk_checksum_url %}
70# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
71ipa_ramdisk_upstream_checksum_url: "{{ kolla_bifrost_ipa_ramdisk_checksum_url }}"
72{% endif %}
73
74{% if kolla_bifrost_ipa_ramdisk_checksum_algorithm %}
75# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
76ipa_ramdisk_upstream_checksum_algo: "{{ kolla_bifrost_ipa_ramdisk_checksum_algorithm }}"
77{% endif %}
78
59{% if kolla_bifrost_extra_globals %} 79{% if kolla_bifrost_extra_globals %}
60############################################################################### 80###############################################################################
61# Extra configuration 81# Extra configuration
diff --git a/ansible/roles/kolla-openstack/defaults/main.yml b/ansible/roles/kolla-openstack/defaults/main.yml
index ae90e42..48c1c4e 100644
--- a/ansible/roles/kolla-openstack/defaults/main.yml
+++ b/ansible/roles/kolla-openstack/defaults/main.yml
@@ -227,10 +227,26 @@ kolla_inspector_extra_kernel_options: []
227# Mutually exclusive with kolla_inspector_ipa_kernel_path. 227# Mutually exclusive with kolla_inspector_ipa_kernel_path.
228kolla_inspector_ipa_kernel_upstream_url: 228kolla_inspector_ipa_kernel_upstream_url:
229 229
230# URL of checksum of Ironic Python Agent (IPA) kernel image for Ironic
231# inspector. Mutually exclusive with kolla_inspector_ipa_kernel_path.
232kolla_inspector_ipa_kernel_checksum_url:
233
234# Algorithm of checksum of Ironic Python Agent (IPA) kernel image for Ironic
235# inspector. Mutually exclusive with kolla_inspector_ipa_kernel_path.
236kolla_inspector_ipa_kernel_checksum_algorithm:
237
230# URL of Ironic Python Agent (IPA) ramdisk image for Ironic Inspector. 238# URL of Ironic Python Agent (IPA) ramdisk image for Ironic Inspector.
231# Mutually exclusive with kolla_inspector_ipa_ramdisk_path. 239# Mutually exclusive with kolla_inspector_ipa_ramdisk_path.
232kolla_inspector_ipa_ramdisk_upstream_url: 240kolla_inspector_ipa_ramdisk_upstream_url:
233 241
242# URL of checksum of Ironic Python Agent (IPA) ramdisk image for Ironic
243# Inspector. Mutually exclusive with kolla_inspector_ipa_ramdisk_path.
244kolla_inspector_ipa_ramdisk_checksum_url:
245
246# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image for Ironic
247# Inspector. Mutually exclusive with kolla_inspector_ipa_ramdisk_path.
248kolla_inspector_ipa_ramdisk_checksum_algorithm:
249
234# Path to Ironic Python Agent (IPA) kernel image for Ironic Inspector. 250# Path to Ironic Python Agent (IPA) kernel image for Ironic Inspector.
235# Mutually exclusive with kolla_inspector_ipa_kernel_upstream_url. 251# Mutually exclusive with kolla_inspector_ipa_kernel_upstream_url.
236kolla_inspector_ipa_kernel_path: 252kolla_inspector_ipa_kernel_path:
diff --git a/ansible/roles/kolla-openstack/tasks/config.yml b/ansible/roles/kolla-openstack/tasks/config.yml
index ea1ff39..42f2cd6 100644
--- a/ansible/roles/kolla-openstack/tasks/config.yml
+++ b/ansible/roles/kolla-openstack/tasks/config.yml
@@ -36,29 +36,29 @@
36 - { src: zookeeper.cfg.j2, dest: zookeeper.cfg, enabled: "{{ kolla_enable_zookeeper }}" } 36 - { src: zookeeper.cfg.j2, dest: zookeeper.cfg, enabled: "{{ kolla_enable_zookeeper }}" }
37 when: item.enabled | bool 37 when: item.enabled | bool
38 38
39- name: Ensure the ironic inspector kernel and ramdisk are downloaded 39- name: Ensure ironic inspector kernel and ramdisk images are present
40 get_url: 40 vars:
41 url: "{{ item.url }}" 41 image_download_url: "{{ item.url }}"
42 dest: "{{ kolla_node_custom_config_path }}/ironic/{{ item.dest }}" 42 image_download_checksum_url: "{{ item.checksum_url }}"
43 mode: 0640 43 image_download_checksum_algorithm: "{{ item.checksum_algorithm }}"
44 with_items: 44 image_download_path: "{{ item.path }}"
45 - { url: "{{ kolla_inspector_ipa_kernel_upstream_url }}", dest: "ironic-agent.kernel" } 45 image_download_dest: "{{ item.dest }}"
46 - { url: "{{ kolla_inspector_ipa_ramdisk_upstream_url }}", dest: "ironic-agent.initramfs" } 46 include_role:
47 when: 47 name: image-download
48 - kolla_enable_ironic | bool
49 - item.url != None
50
51- name: Ensure the ironic inspector kernel and ramdisk are copied
52 copy:
53 src: "{{ item.path }}"
54 dest: "{{ kolla_node_custom_config_path }}/ironic/{{ item.dest }}"
55 mode: 0640
56 with_items: 48 with_items:
57 - { path: "{{ kolla_inspector_ipa_kernel_path }}", dest: "ironic-agent.kernel" } 49 - url: "{{ kolla_inspector_ipa_kernel_upstream_url }}"
58 - { path: "{{ kolla_inspector_ipa_ramdisk_path }}", dest: "ironic-agent.initramfs" } 50 checksum_url: "{{ kolla_inspector_ipa_kernel_checksum_url }}"
59 when: 51 checksum_algorithm: "{{ kolla_inspector_ipa_kernel_checksum_algorithm }}"
60 - kolla_enable_ironic | bool 52 path: "{{ kolla_inspector_ipa_kernel_path }}"
61 - item.path != None 53 dest: "{{ kolla_node_custom_config_path }}/ironic/ironic-agent.kernel"
54 - url: "{{ kolla_inspector_ipa_ramdisk_upstream_url }}"
55 checksum_url: "{{ kolla_inspector_ipa_ramdisk_checksum_url }}"
56 checksum_algorithm: "{{ kolla_inspector_ipa_ramdisk_checksum_algorithm }}"
57 path: "{{ kolla_inspector_ipa_ramdisk_path }}"
58 dest: "{{ kolla_node_custom_config_path }}/ironic/ironic-agent.initramfs"
59 when: kolla_enable_ironic | bool
60 loop_control:
61 label: "{{ item.dest }}"
62 62
63# We support a fairly flexible mechanism of dropping config file templates into 63# We support a fairly flexible mechanism of dropping config file templates into
64# an 'extra' config directory, and passing these through to kolla-ansible. We 64# an 'extra' config directory, and passing these through to kolla-ansible. We
diff --git a/doc/source/upgrading.rst b/doc/source/upgrading.rst
index 2745be3..00168b2 100644
--- a/doc/source/upgrading.rst
+++ b/doc/source/upgrading.rst
@@ -145,9 +145,17 @@ Upgrading Ironic Deployment Images
145 145
146Prior to upgrading the OpenStack control plane you should upgrade 146Prior to upgrading the OpenStack control plane you should upgrade
147the deployment images. If you are using prebuilt images, update 147the deployment images. If you are using prebuilt images, update
148``ipa_kernel_upstream_url`` and ``ipa_ramdisk_upstream_url`` in 148the following variables in ``etc/kayobe/ipa.yml`` accordingly:
149``etc/kayobe/ipa.yml``, alternatively, you can update the files that the URLs 149
150point to. If building the images locally, follow the process outlined in 150* ``ipa_kernel_upstream_url``
151* ``ipa_kernel_checksum_url``
152* ``ipa_kernel_checksum_algorithm``
153* ``ipa_ramdisk_upstream_url``
154* ``ipa_ramdisk_checksum_url``
155* ``ipa_ramdisk_checksum_algorithm``
156
157Alternatively, you can update the files that the URLs point to. If building the
158images locally, follow the process outlined in
151:ref:`building_ironic_deployment_images`. 159:ref:`building_ironic_deployment_images`.
152 160
153To get Ironic to use an updated set of overcloud deployment images, you can run:: 161To get Ironic to use an updated set of overcloud deployment images, you can run::
diff --git a/etc/kayobe/bifrost.yml b/etc/kayobe/bifrost.yml
index 9c590bc..ceffb27 100644
--- a/etc/kayobe/bifrost.yml
+++ b/etc/kayobe/bifrost.yml
@@ -70,6 +70,27 @@
70#kolla_bifrost_inspector_deploy_ramdisk: 70#kolla_bifrost_inspector_deploy_ramdisk:
71 71
72############################################################################### 72###############################################################################
73# Ironic Python Agent (IPA) configuration.
74
75# URL of Ironic Python Agent (IPA) kernel image.
76#kolla_bifrost_ipa_kernel_upstream_url:
77
78# URL of checksum of Ironic Python Agent (IPA) kernel image.
79#kolla_bifrost_ipa_kernel_checksum_url:
80
81# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
82#kolla_bifrost_ipa_kernel_checksum_algorithm:
83
84# URL of Ironic Python Agent (IPA) ramdisk image.
85#kolla_bifrost_ipa_ramdisk_upstream_url:
86
87# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
88#kolla_bifrost_ipa_ramdisk_checksum_url:
89
90# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
91#kolla_bifrost_ipa_ramdisk_checksum_algorithm:
92
93###############################################################################
73# Inventory configuration. 94# Inventory configuration.
74 95
75# Server inventory for Bifrost. 96# Server inventory for Bifrost.
diff --git a/etc/kayobe/inspector.yml b/etc/kayobe/inspector.yml
index dc41218..ac83dd3 100644
--- a/etc/kayobe/inspector.yml
+++ b/etc/kayobe/inspector.yml
@@ -8,9 +8,21 @@
8# URL of Ironic Python Agent (IPA) kernel image. 8# URL of Ironic Python Agent (IPA) kernel image.
9#inspector_ipa_kernel_upstream_url: 9#inspector_ipa_kernel_upstream_url:
10 10
11# URL of checksum of Ironic Python Agent (IPA) kernel image.
12#inspector_ipa_kernel_checksum_url:
13
14# Algorithm of checksum of Ironic Python Agent (IPA) kernel image.
15#inspector_ipa_kernel_checksum_algorithm:
16
11# URL of Ironic Python Agent (IPA) ramdisk image. 17# URL of Ironic Python Agent (IPA) ramdisk image.
12#inspector_ipa_ramdisk_upstream_url: 18#inspector_ipa_ramdisk_upstream_url:
13 19
20# URL of checksum of Ironic Python Agent (IPA) ramdisk image.
21#inspector_ipa_ramdisk_checksum_url:
22
23# Algorithm of checksum of Ironic Python Agent (IPA) ramdisk image.
24#inspector_ipa_ramdisk_checksum_algorithm:
25
14############################################################################### 26###############################################################################
15# Ironic inspector processing configuration. 27# Ironic inspector processing configuration.
16 28
diff --git a/etc/kayobe/ipa.yml b/etc/kayobe/ipa.yml
index 3464ef2..828a8ab 100644
--- a/etc/kayobe/ipa.yml
+++ b/etc/kayobe/ipa.yml
@@ -56,12 +56,24 @@
56# URL of Ironic deployment kernel image to download. 56# URL of Ironic deployment kernel image to download.
57#ipa_kernel_upstream_url: 57#ipa_kernel_upstream_url:
58 58
59# URL of checksum of Ironic deployment kernel image.
60#ipa_kernel_checksum_url:
61
62# Algorithm of checksum of Ironic deployment kernel image.
63#ipa_kernel_checksum_algorithm:
64
59# Name of Ironic deployment ramdisk image to register in Glance. 65# Name of Ironic deployment ramdisk image to register in Glance.
60#ipa_images_ramdisk_name: 66#ipa_images_ramdisk_name:
61 67
62# URL of Ironic deployment ramdisk image to download. 68# URL of Ironic deployment ramdisk image to download.
63#ipa_ramdisk_upstream_url: 69#ipa_ramdisk_upstream_url:
64 70
71# URL of checksum of Ironic deployment ramdisk image.
72#ipa_ramdisk_checksum_url:
73
74# Algorithm of checksum of Ironic deployment ramdisk image.
75#ipa_ramdisk_checksum_algorithm:
76
65############################################################################### 77###############################################################################
66# Ironic Python Agent (IPA) deployment configuration. 78# Ironic Python Agent (IPA) deployment configuration.
67 79
diff --git a/releasenotes/notes/fix-ipa-image-download-3f90f0f40d0feafd.yaml b/releasenotes/notes/fix-ipa-image-download-3f90f0f40d0feafd.yaml
new file mode 100644
index 0000000..799d73a
--- /dev/null
+++ b/releasenotes/notes/fix-ipa-image-download-3f90f0f40d0feafd.yaml
@@ -0,0 +1,36 @@
1---
2upgrade:
3 - |
4 It is now possible to specify a URL of a file containing a checksum of the
5 Ironic Python Agent (IPA) images for the seed and overcloud Ironic and
6 Ironic Inspector services. This allows Kayobe to detect changes in the
7 image content and download as necessary. If specifying IPA images via URL,
8 the checksums should be configured accordingly.
9
10 The checksum URLs and algorithms are configured via these variables:
11
12 * ``{{ ipa_kernel_checksum_url }}``
13 * ``{{ ipa_kernel_checksum_algorithm }}``
14 * ``{{ ipa_ramdisk_checksum_url }}``
15 * ``{{ ipa_ramdisk_checksum_algorithm }}``
16
17 For the seed this may be customised via these variables:
18
19 * ``{{ kolla_bifrost_ipa_kernel_checksum_url }}``
20 * ``{{ kolla_bifrost_ipa_kernel_checksum_algorithm }}``
21 * ``{{ kolla_bifrost_ipa_ramdisk_checksum_url }}``
22 * ``{{ kolla_bifrost_ipa_ramdisk_checksum_algorithm }}``
23
24 For the overcloud Ironic Inspector service this may be customised via these
25 variables:
26
27 * ``{{ inspector_ipa_kernel_checksum_url }}``
28 * ``{{ inspector_ipa_kernel_checksum_algorithm }}``
29 * ``{{ inspector_ipa_ramdisk_checksum_url }}``
30 * ``{{ inspector_ipa_ramdisk_checksum_algorithm }}``
31fixes:
32 - |
33 Fixes an issue with downloading Ironic Python Agent (IPA) images where new
34 images would not be downloaded if the image had been downloaded previously.
35 See `Story 2001660 <https://storyboard.openstack.org/#!/story/2001660>`__
36 for details.