Skip to content

Commit

Permalink
Merge pull request #330 from stackhpc/upstream/2024.1-2024-09-30
Browse files Browse the repository at this point in the history
Synchronise 2024.1 with upstream
  • Loading branch information
priteau authored Sep 30, 2024
2 parents 89a2109 + 324da76 commit f5ffa70
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 47 deletions.
38 changes: 5 additions & 33 deletions ansible/kolla-openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,37 +46,6 @@
when: not item.stat.exists
tags:
- config-validation

- name: Check whether the image cache directory exists
local_action:
module: stat
path: "{{ hostvars.localhost.image_cache_path }}"
get_checksum: False
mime: False
register: image_cache_stat

- name: Ensure the image cache directory exists
local_action:
module: file
path: "{{ hostvars.localhost.image_cache_path }}"
state: directory
owner: "{{ lookup('env', 'USER') }}"
group: "{{ lookup('env', 'USER') }}"
become: True
when: >-
not image_cache_stat.stat.exists or
not image_cache_stat.stat.writeable
- name: Ensure Ironic Python Agent images are copied onto the local machine
fetch:
src: "{{ image_cache_path }}/{{ ipa_image_name }}/{{ item.src }}"
dest: "{{ hostvars.localhost.image_cache_path }}/{{ ipa_image_name }}/{{ item.dest }}"
flat: True
with_items:
- src: "{{ ipa_images[0] }}"
dest: "{{ ipa_images_kernel_name }}"
- src: "{{ ipa_images[1] }}"
dest: "{{ ipa_images_ramdisk_name }}"
when:
- kolla_enable_ironic | bool
- ipa_build_images | bool
Expand Down Expand Up @@ -149,9 +118,11 @@

- name: Set facts containing IPA kernel and ramdisk paths
set_fact:
kolla_inspector_ipa_kernel_path: "{{ image_cache_path }}/{{ ipa_image_name }}/{{ ipa_images_kernel_name }}"
kolla_inspector_ipa_ramdisk_path: "{{ image_cache_path }}/{{ ipa_image_name }}/{{ ipa_images_ramdisk_name }}"
kolla_inspector_ipa_kernel_path: "{{ hostvars[inspector_ipa_host].image_cache_path }}/{{ ipa_image_name }}/{{ ipa_images_kernel_name }}"
kolla_inspector_ipa_ramdisk_path: "{{ hostvars[inspector_ipa_host].image_cache_path }}/{{ ipa_image_name }}/{{ ipa_images_ramdisk_name }}"
when: ipa_build_images | bool
vars:
inspector_ipa_host: "{{ groups['controllers_with_ironic_enabled_True'][0] }}"
when: kolla_enable_ironic | bool
tags:
- config
Expand All @@ -169,6 +140,7 @@
kolla_inspector_swift_auth:
auth_type: none
endpoint_override: "http://{% raw %}{{ api_interface_address }}{% endraw %}:{{ inspector_store_port }}"
kolla_inspector_ipa_host: "{{ groups['controllers_with_ironic_enabled_True'][0] }}"
kolla_openstack_custom_config_paths_extra_multi_env_static:
- "{{ kayobe_config_path }}"
kolla_openstack_custom_config_paths_extra_multi_env: "{{ kolla_openstack_custom_config_paths_extra_multi_env_static + kayobe_env_search_paths }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible/roles/image-download/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ image_download_path:

# Path to the image's destination.
image_download_dest:

# Host from which to fetch the image.
# Only used when image_download_path is set.
image_download_host: "{{ inventory_hostname }}"
40 changes: 26 additions & 14 deletions ansible/roles/image-download/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
- name: Fail if the checksum algorithm is not set
fail:
msg: "Checksum algorithm for image {{ image_download_url }} not set"
when: image_download_checksum_algorithm is none or
image_download_checksum_algorithm == ""
when: image_download_checksum_algorithm is falsy

- name: Get the expected checksum
uri:
Expand All @@ -21,8 +20,7 @@
retries: 3
delay: 5
when:
- image_download_checksum_url is not none
- image_download_checksum_url != ""
- image_download_checksum_url is truthy

- name: Ensure the image is downloaded
vars:
Expand All @@ -42,14 +40,28 @@
retries: 3
delay: 5
when:
- image_download_url is not none
- image_download_url != ""
- image_download_url is truthy

- name: Ensure the local image is copied
copy:
src: "{{ image_download_path }}"
dest: "{{ image_download_dest }}"
mode: 0640
when:
- image_download_path is not none
- image_download_path != ""
- when: image_download_path is truthy
block:
- name: Ensure the local image is copied
copy:
src: "{{ image_download_path }}"
dest: "{{ image_download_dest }}"
mode: 0640
when:
- image_download_host is falsy

- name: Ensure the remote image is fetched
fetch:
src: "{{ image_download_path }}"
dest: "{{ image_download_dest }}"
mode: 0640
flat: true
when:
- image_download_host is truthy
delegate_to: "{{ image_download_host | default('localhost', true) }}"
vars:
# NOTE: Without this, the hosts's ansible_host variable will not be
# respected when using delegate_to.
ansible_host: "{{ hostvars[image_download_host].ansible_host | default(image_download_host) }}"
5 changes: 5 additions & 0 deletions ansible/roles/kolla-openstack/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,11 @@ kolla_inspector_ipa_kernel_path:
# Mutually exclusive with kolla_inspector_ipa_ramdisk_upstream_url.
kolla_inspector_ipa_ramdisk_path:

# Host from which to fetch Ironic Python Agent (IPA) kernel and ramdisk images
# for Ironic Inspector. Only used when kolla_inspector_ipa_kernel_path or
# kolla_inspector_ipa_ramdisk_path is set.
kolla_inspector_ipa_host:

# Whether to enable the Swift introspection data store.
kolla_inspector_enable_swift:

Expand Down
1 change: 1 addition & 0 deletions ansible/roles/kolla-openstack/tasks/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
image_download_checksum_algorithm: "{{ item.checksum_algorithm }}"
image_download_path: "{{ item.path }}"
image_download_dest: "{{ item.dest }}"
image_download_host: "{{ kolla_inspector_ipa_host }}"
include_role:
name: image-download
with_items:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixes an issue when using overcloud Ironic with a shared Ansible control
host. The use of a shared cache directory could lead to a failure to
download Ironic Python Agent (IPA) images. `LP#2069845
<https://bugs.launchpad.net/kayobe/+bug/2069845>`__

0 comments on commit f5ffa70

Please sign in to comment.