Skip to content

Commit 508fd24

Browse files
Merge pull request #858 from slagle/support-bootc-fixes
Support bootc fixes
2 parents 6a85d17 + a590bf7 commit 508fd24

File tree

36 files changed

+135
-31
lines changed

36 files changed

+135
-31
lines changed

molecule/common/test_deps/defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ test_deps_setup_edpm: false
2020
test_deps_mirrors_file_path: /etc/ci/mirror_info.sh
2121
test_deps_setup_stream: true
2222
test_deps_setup_ceph: false
23+
# Value to use for the bootc fact
24+
test_deps_bootc_fact: false

molecule/common/test_deps/tasks/main.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,29 @@
152152
releasever: "{{ ansible_facts['distribution_major_version'] }}"
153153
when:
154154
- (test_deps_extra_packages | length) > 0
155+
156+
- name: Bootc block
157+
become: true
158+
block:
159+
- name: Check for /etc/ansible/facts.d/bootc.fact
160+
stat:
161+
path: /etc/ansible/facts.d/bootc.fact
162+
register: bootc_fact_stat
163+
164+
- name: Create /etc/ansible/facts.d
165+
file:
166+
state: directory
167+
path: /etc/ansible/facts.d
168+
169+
- name: Create /etc/ansible/facts.d/bootc.fact
170+
copy:
171+
dest: /etc/ansible/facts.d/bootc.fact
172+
content: |
173+
#!/bin/bash
174+
echo "{{ test_deps_bootc_fact | lower }}"
175+
mode: 0755
176+
177+
- name: Gather local facts
178+
ansible.builtin.setup:
179+
gather_subset:
180+
- "local"

playbooks/bootstrap.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
name: osp.edpm.edpm_kernel
4343
tags:
4444
- edpm_kernel
45+
when: not ansible_local.bootc
4546
- name: Import edpm_tuned
4647
ansible.builtin.import_role:
4748
name: osp.edpm.edpm_tuned
@@ -53,9 +54,11 @@
5354
tasks_from: kernelargs.yml
5455
tags:
5556
- edpm_kernel
57+
when: not ansible_local.bootc
5658
- name: Configure KSM for kernel
5759
ansible.builtin.import_role:
5860
name: osp.edpm.edpm_kernel
5961
tasks_from: ksm.yml
6062
tags:
6163
- edpm_kernel
64+
when: not ansible_local.bootc

roles/edpm_bootstrap/tasks/bootstrap.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@
6060
- name: Execute bootstrap command
6161
ansible.builtin.import_tasks: bootstrap_command.yml
6262

63-
- name: Import packages tasks
64-
ansible.builtin.import_tasks: packages.yml
63+
- name: Include packages tasks
64+
ansible.builtin.include_tasks: packages.yml
65+
when: not ansible_local.bootc
6566

6667
- name: Set selinux state
6768
ansible.posix.selinux:
@@ -107,8 +108,9 @@
107108
#!/bin/sh
108109
make_resolv_conf() { : ; }
109110
110-
- name: Configure swap
111-
ansible.builtin.import_tasks: swap.yml
111+
- name: Include swap tasks
112+
ansible.builtin.include_tasks: swap.yml
113+
when: not ansible_local.bootc
112114

113115
- name: FIPS tasks
114116
ansible.builtin.import_tasks: fips.yml

roles/edpm_bootstrap/tasks/packages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
- name: Install and enable network service
6666
when:
6767
- (edpm_bootstrap_legacy_network_packages | length) > 0
68+
- not ansible_local.bootc
6869
become: true
6970
block:
7071
- name: Deploy network-scripts required for deprecated network service

roles/edpm_bootstrap/tasks/swap.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- name: Configure swap file
1818
when:
19+
- not ansible_local.bootc
1920
- not edpm_bootstrap_swap_partition_enabled|bool
2021
- edpm_bootstrap_swap_size_megabytes|int > 0
2122
become: true

roles/edpm_container_manage/files/edpm-container-shutdown-service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ RefuseManualStop=yes
1111
Type=oneshot
1212
ExecStart=/bin/true
1313
RemainAfterExit=yes
14-
ExecStop=/usr/libexec/edpm-container-shutdown
14+
ExecStop=/var/local/libexec/edpm-container-shutdown
1515
# Wait at most 900 seconds for all containers to shutdown
1616
TimeoutStopSec=900
1717

roles/edpm_container_manage/tasks/shutdown.yml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,42 @@
1717
- name: Create EDPM Container systemd service
1818
become: true
1919
block:
20+
- name: "Create /var/local/libexec dir"
21+
file:
22+
state: directory
23+
path: /var/local/libexec
24+
recurse: true
25+
setype: container_file_t
26+
2027
- name: "Deploy edpm-container-shutdown and edpm-start-podman-container"
2128
ansible.builtin.copy:
2229
src: "{{ role_path }}/files/{{ item }}"
23-
dest: "/usr/libexec/{{ item }}"
30+
dest: "/var/local/libexec/{{ item }}"
2431
mode: '0700'
2532
owner: root
2633
group: root
34+
setype: container_file_t
2735
loop:
2836
- 'edpm-container-shutdown'
2937
- 'edpm-start-podman-container'
30-
- name: "Create /usr/lib/systemd/system/edpm-container-shutdown.service"
38+
39+
- name: "Create systemd preset dir"
40+
ansible.builtin.file:
41+
state: "directory"
42+
path: "/etc/systemd/system-preset"
43+
mode: 0644
44+
45+
- name: "Create /etc/systemd/system/edpm-container-shutdown.service"
3146
ansible.builtin.copy:
3247
src: "{{ role_path }}/files/edpm-container-shutdown-service"
33-
dest: "/usr/lib/systemd/system/edpm-container-shutdown.service"
48+
dest: "/etc/systemd/system/edpm-container-shutdown.service"
3449
mode: '0644'
3550
owner: root
3651
group: root
37-
- name: "Create /usr/lib/systemd/system-preset/91-edpm-container-shutdown.preset"
52+
- name: "Create /etc/systemd/system-preset/91-edpm-container-shutdown.preset"
3853
ansible.builtin.copy:
3954
src: "{{ role_path }}/files/91-edpm-container-shutdown-preset"
40-
dest: "/usr/lib/systemd/system-preset/91-edpm-container-shutdown.preset"
55+
dest: "/etc/systemd/system-preset/91-edpm-container-shutdown.preset"
4156
mode: '0644'
4257
owner: root
4358
group: root
@@ -47,17 +62,17 @@
4762
state: started
4863
enabled: true
4964
daemon_reload: true
50-
- name: "Create /usr/lib/systemd/system/netns-placeholder.service"
65+
- name: "Create /etc/systemd/system/netns-placeholder.service"
5166
ansible.builtin.copy:
5267
src: "{{ role_path }}/files/netns-placeholder-service"
53-
dest: "/usr/lib/systemd/system/netns-placeholder.service"
68+
dest: "/etc/systemd/system/netns-placeholder.service"
5469
mode: '0644'
5570
owner: root
5671
group: root
57-
- name: "Create /usr/lib/systemd/system-preset/91-netns-placeholder.preset"
72+
- name: "Create /etc/systemd/system-preset/91-netns-placeholder.preset"
5873
ansible.builtin.copy:
5974
src: "{{ role_path }}/files/91-netns-placeholder-preset"
60-
dest: "/usr/lib/systemd/system-preset/91-netns-placeholder.preset"
75+
dest: "/etc/systemd/system-preset/91-netns-placeholder.preset"
6176
mode: '0644'
6277
owner: root
6378
group: root

roles/edpm_container_manage/templates/systemd-service.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Wants={{ lookup('dict', container_data_unit).value.depends_on | default([]) | jo
88
[Service]
99
Restart=always
1010
{% if lookup('dict', container_data_unit).value.depends_on is defined and (lookup('dict', container_data_unit).value.depends_on | length > 0) and podman_drop_in | default('false') %}
11-
ExecStart=/usr/libexec/edpm-start-podman-container {{ lookup('dict', container_data_unit).key }}
11+
ExecStart=/var/local/libexec/edpm-start-podman-container {{ lookup('dict', container_data_unit).key }}
1212
{% else %}
1313
ExecStart=/usr/bin/podman start {{ lookup('dict', container_data_unit).key }}
1414
{% endif %}

roles/edpm_frr/tasks/run.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
- name: Ensure /usr/libexec/edpm-start-podman-container exists
17+
- name: Ensure /var/local/libexec/edpm-start-podman-container exists
1818
ansible.builtin.import_role:
1919
name: edpm_container_manage
2020
tasks_from: shutdown.yml

0 commit comments

Comments
 (0)