Skip to content

rpm_ostree_pkg: fails to set needs_reboot correctly #10009

Open
@millerthegorilla

Description

@millerthegorilla

Summary

It is expected that ansible tasks are idempotent. However, when running rpm_ostree_package to install already installed, but pending, packages, the needs_reboot is returned as false, when if there are pending packages, as listed by rpm-ostree db diff the needs_reboot should be true.

Issue Type

Bug Report

Component Name

rpm_ostree_pkg

Ansible Version

ansible [core 2.18.4]
  config file = None
  configured module search path = ['/var/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /var/home/user/src/ansible-collection-picoreos/millerthegorilla/picoreos/.venv/lib64/python3.13/site-packages/ansible
  ansible collection location = /var/home/user/.ansible/collections:/usr/share/ansible/collections
  executable location = /var/home/user/src/ansible-collection-picoreos/millerthegorilla/picoreos/.venv/bin/ansible
  python version = 3.13.2 (main, Feb  4 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] (/var/home/user/src/ansible-collection-picoreos/millerthegorilla/picoreos/.venv/bin/python)
  jinja version = 3.1.6
  libyaml = True

Community.general Version

Collection        Version
----------------- -------
community.general 10.5.0 

Configuration

config...

CONFIG_FILE() = None
EDITOR(env: EDITOR) = /usr/bin/nano

GALAXY_SERVERS:

OS / Environment

fedora silverblue 41 host addressing a stable coreos remote, on a raspberry pi4b.

Steps to Reproduce

on second run, without reboot of remote. rpm-ostree db diff on remote reveals a pending deployment.

- name: Ensure ClamAV packages are installed.
  package:
    name: "{{ clamav_packages }}"
  register: clamav_packages_install

- name: Reboot if necessary (when rpm-ostree is package manager)
  ansible.builtin.reboot:
    msg: "Reboot initiated by Ansible"
  when:
    - ansible_package_use is defined
    - '"rpm_ostree_pkg" in ansible_package_use'
    - clamav_packages_install.needs_reboot

needs_reboot is false, when it should be true.

Expected Results

clamav_packages_install.needs_reboot should be true

Actual Results

needs_reboot is false

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodule

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions