Skip to content

Commit 1c4994b

Browse files
authored
Merge pull request #45 from bshephar/fact-for-all
Handle non-bootc nodes with the custom fact
2 parents 5ee31c1 + 032b63e commit 1c4994b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bootc/ansible-facts/bootc.fact

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
#!/usr/bin/env bash
22

33
BOOTC_SYSTEM="false"
4+
BOOTC_PACKAGE=$(rpm -qa | grep bootc)
5+
6+
# If the system isn't using bootc, we can exit early here since the
7+
# RPM wont be installed.
8+
if [[ $BOOTC_PACKAGE == "" ]]; then
9+
echo ${BOOTC_SYSTEM}
10+
exit
11+
fi
412

513
is_bootc() {
614
BOOTC_STATUS=$(sudo bootc status --json | jq .status.type)
715
if [[ "$BOOTC_STATUS" == \"bootcHost\" ]]; then
8-
BOOTC_SYSTEM="true"
16+
BOOTC_SYSTEM="true"
917
fi
1018
}
1119

0 commit comments

Comments
 (0)