Skip to content

Commit a5cf980

Browse files
Merge pull request #1033 from slagle/bootc-update
Move bootc update tasks to edpm_update_system
2 parents 9797092 + cb156f0 commit a5cf980

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

roles/edpm_update/defaults/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,3 @@ edpm_update_exclude_packages:
3131
- openvswitch
3232

3333
edpm_update_running_services: "{{ edpm_service_types }}"
34-
35-
# The bootc container image is provided by the OpenStackVersion
36-
# CR using the bootcOsContainerImage parameter
37-
edpm_bootc_os_container_image: ""

roles/edpm_update/tasks/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@
3939
- ansible_local.bootc is not defined or not ansible_local.bootc
4040

4141
- name: Update OS (bootc)
42-
ansible.builtin.include_tasks: bootc.yml
43-
when: ansible_local.bootc
42+
ansible.builtin.import_role:
43+
name: osp.edpm.edpm_update_system
44+
tasks_from: bootc.yml
45+
when: ansible_local is defined and ansible_local.bootc
4446

4547
- name: Update containers
4648
ansible.builtin.include_tasks: containers.yml

roles/edpm_update_system/defaults/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,7 @@ edpm_update_system_include_packages:
2929

3030
# List of packages to exclude from the update
3131
edpm_update_system_exclude_packages: []
32+
33+
# The bootc container image is provided by the OpenStackVersion
34+
# CR using the bootcOsContainerImage parameter
35+
edpm_update_system_bootc_os_container_image: ""

roles/edpm_update/tasks/bootc.yml renamed to roles/edpm_update_system/tasks/bootc.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@
1616

1717

1818
- name: Update bootc image
19-
ansible.builtin.shell: bootc switch "{{ edpm_bootc_os_container_image }}"
19+
ansible.builtin.shell: bootc switch "{{ edpm_update_system_bootc_os_container_image }}"
2020
become: true
2121
register: bootc_result
2222
changed_when: bootc_result.rc != 0
23+
24+
- name: Create directory required by edpm-reboot role
25+
become: true
26+
ansible.builtin.file:
27+
path: /var/lib/openstack/reboot_required/
28+
state: directory
29+
mode: "0755"
30+
when:
31+
- bootc_result.changed
32+
33+
- name: Create required file to enforce a reboot
34+
become: true
35+
ansible.builtin.file:
36+
path: /var/lib/openstack/reboot_required/bootc_reboot
37+
state: touch
38+
mode: "0600"
39+
when:
40+
- bootc_result.changed

roles/edpm_update_system/tasks/main.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,5 @@
3636
- ansible_local.bootc is not defined or not ansible_local.bootc
3737

3838
- name: Update OS (bootc)
39-
ansible.builtin.import_role:
40-
name: osp.edpm.edpm_update
41-
tasks_from: bootc.yml
39+
ansible.builtin.include_tasks: bootc.yml
4240
when: ansible_local is defined and ansible_local.bootc

0 commit comments

Comments
 (0)