You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to run an ansible role which does three things:
Install a list of packages
Update the system
Handle rebooting to switch to the new deployment
However, in a typical deployment, I have been finding that the first step of installing a list of packages will always do the full system update when one is available. The second step, updating the system, then completes as 'ok'.
I've traced this down to the difference in behavior between these two commands:
$ sudo rpm-ostree install python3-requests
error: Package/capability 'python3-requests' is already requested
$ sudo rpm-ostree install python3-requests --idempotent
Checking out tree 870e2c8... done
<system update continues>
Ideally, I would expect the rpm_ostree_pkg module to simply check if the package is already requested, and if so do nothing. However, because of the --idempotent flag included on line 166, I always end up with a system upgrade happening when I only want to check for (and potentially install) a single package.
Perhaps a simple way to address this would be to add an idempotent parameter to the module, which defaults to true and controls the addition or removal of this flag? Not sure what would make the most sense in this case; happy to make a pull request with that change.
Fedora Silverblue as deployment machine, running Ansible inside a podman container. Fedora CoreOS as the target machine.
Steps to Reproduce
---
- name: Ensure required packages are installedbecome: truecommunity.general.rpm_ostree_pkg:
name: "python3-requests"state: presentnotify: Reboot system
- name: Perform system updatebecome: truetags: update-systemblock:
- name: Stop automatic update serviceansible.builtin.service:
name: zincatistate: stoppednotify: Start coreos automatic update service
- name: Upgrade all packagesansible.posix.rpm_ostree_upgrade:
notify: Reboot system
Expected Results
Expect the first task to pass unchanged (status 'ok') since python3-requests is already installed. Expected the third task to upgrade the whole system and then reboot.
Actual behavior was the first task passed with status 'changed', and the third task passed unchanged (status 'ok'). First task fully upgraded the system and triggered the reboot handler.
Summary
I'm trying to run an ansible role which does three things:
However, in a typical deployment, I have been finding that the first step of installing a list of packages will always do the full system update when one is available. The second step, updating the system, then completes as 'ok'.
I've traced this down to the difference in behavior between these two commands:
Ideally, I would expect the
rpm_ostree_pkg
module to simply check if the package is already requested, and if so do nothing. However, because of the--idempotent
flag included on line 166, I always end up with a system upgrade happening when I only want to check for (and potentially install) a single package.Perhaps a simple way to address this would be to add an
idempotent
parameter to the module, which defaults totrue
and controls the addition or removal of this flag? Not sure what would make the most sense in this case; happy to make a pull request with that change.Issue Type
Bug Report
Component Name
rpm_ostree_pkg, https://github.com/ansible-collections/community.general/blob/e5761bd7c745c3b03d083d1d685badc0ea4ba577/plugins/modules/rpm_ostree_pkg.py
Ansible Version
Community.general Version
Configuration
OS / Environment
Fedora Silverblue as deployment machine, running Ansible inside a podman container. Fedora CoreOS as the target machine.
Steps to Reproduce
Expected Results
Expect the first task to pass unchanged (status 'ok') since
python3-requests
is already installed. Expected the third task to upgrade the whole system and then reboot.Actual behavior was the first task passed with status 'changed', and the third task passed unchanged (status 'ok'). First task fully upgraded the system and triggered the reboot handler.
Actual Results:
Code of Conduct
The text was updated successfully, but these errors were encountered: