Skip to content

Commit db17840

Browse files
authored
Merge pull request #40 from bshephar/bootc-fact
Add bootc fact to container
2 parents 1f6b557 + 970a710 commit db17840

File tree

2 files changed

+46
-28
lines changed

2 files changed

+46
-28
lines changed

bootc/Containerfile.centos9

Lines changed: 32 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,38 @@ RUN rm -rf /etc/yum.repos.d/*.repo
44
COPY output/yum.repos.d /etc/yum.repos.d
55

66
ARG PACKAGES="\
7-
bind-utils \
8-
buildah \
9-
cephadm \
10-
chrony \
11-
cloud-init \
12-
crudini \
13-
crypto-policies-scripts \
14-
device-mapper-multipath \
15-
driverctl \
16-
grubby \
17-
iproute-tc \
18-
iptables-services \
19-
iscsi-initiator-utils \
20-
jq \
21-
lvm2 \
22-
nftables \
23-
numactl \
24-
openssh-server \
25-
openstack-selinux \
26-
openvswitch \
27-
os-net-config \
28-
podman \
29-
python3-libselinux \
30-
python3-pyyaml \
31-
rsync \
32-
tmpwatch \
33-
tuned-profiles-cpu-partitioning \
34-
sysstat"
7+
bind-utils \
8+
buildah \
9+
cephadm \
10+
chrony \
11+
cloud-init \
12+
crudini \
13+
crypto-policies-scripts \
14+
device-mapper-multipath \
15+
driverctl \
16+
grubby \
17+
iproute-tc \
18+
iptables-services \
19+
iscsi-initiator-utils \
20+
jq \
21+
lvm2 \
22+
nftables \
23+
numactl \
24+
openssh-server \
25+
openstack-selinux \
26+
openvswitch \
27+
os-net-config \
28+
podman \
29+
python3-libselinux \
30+
python3-pyyaml \
31+
rsync \
32+
tmpwatch \
33+
tuned-profiles-cpu-partitioning \
34+
sysstat"
3535
ARG ENABLE_UNITS="openvswitch"
3636

3737
RUN dnf -y update && dnf -y install $PACKAGES && dnf clean all && systemctl enable $ENABLE_UNITS
38+
39+
# Drop Ansible fact into place
40+
COPY ansible-facts/bootc.fact /usr/etc/ansible/facts.d/bootc.fact
41+
RUN chmod +x /usr/etc/ansible/facts.d/bootc.fact

bootc/ansible-facts/bootc.fact

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env bash
2+
3+
BOOTC_SYSTEM="false"
4+
5+
is_bootc() {
6+
BOOTC_STATUS=$(sudo bootc status --json | jq .status.type)
7+
if [[ "$BOOTC_STATUS" == \"bootcHost\" ]]; then
8+
BOOTC_SYSTEM="true"
9+
fi
10+
}
11+
12+
is_bootc
13+
14+
echo ${BOOTC_SYSTEM}

0 commit comments

Comments
 (0)