Skip to content

Commit 45102cc

Browse files
committed
Add bootc fact to test_deps
Add tasks to the test_deps role for molecule. That tasks will ensure the custom fact exists. The test_deps_bootc_fact variable can be used to control the value of the fact. Signed-off-by: James Slagle <[email protected]>
1 parent b6a9111 commit 45102cc

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
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"

0 commit comments

Comments
 (0)