-
Task
-
Resolution: Unresolved
-
Undefined
-
None
-
None
-
rhel-system-roles
-
5
-
False
-
-
None
When building an ostree-based (bootc) container image, using ansible-playbook -c local to execute a task with the ansible.builtin.service module fails. The module is unable to correctly detect or manage services within the non-booted container build environment, impacting the usability of many standard roles for image creation.
Steps to Reproduce
1. Create a simple playbook, baseline.yml, to enable a service:
—
name: Configure baseline
hosts: all
become: true
tasks:
- name: Enable firewalld service
ansible.builtin.service:
name: firewalld
enabled: true
2. Create a Containerfile:
FROM registry.redhat.io/rhel9/rhel-bootc:latest
- Install dependencies for the test
RUN dnf -y install ansible-core firewalld - Add playbook and run it
ADD baseline.yml /root/baseline.yml
RUN ansible-playbook -c local /root/baseline.yml
3. Attempt to build the image: podman build -t my-bootc-image .
Actual Result: ❌ The playbook fails with a fatal error on the service task:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find the requested service firewalld: host"}
Solution:
Use the systemd module directly: Replacing the service module with ansible.builtin.systemd works correctly in this environment.
- is cloned by
-
RHEL-120414 add bootc Containerfile test support to tox-lsr
-
- New
-