Skip to content

apt_rpm not upgrade packages if a newer version exists #7414

Closed
@x09

Description

@x09

Summary

If exist new version of package, module has been report - "Nothing to install"
Bug description (on Russian) - https://bugzilla.altlinux.org/48091

Issue Type

Bug Report

Component Name

community.general.apt_rpm

Ansible Version

ansible 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Mar 21 2023, 10:12:38) [GCC 10.3.1 20210703 (ALT Sisyphus 10.3.1-alt2)]

Community.general Version

ansible-galaxy --version
ansible-galaxy 2.9.27
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/site-packages/ansible
  executable location = /usr/bin/ansible-galaxy
  python version = 3.9.16 (main, Mar 21 2023, 10:12:38) [GCC 10.3.1 20210703 (ALT Sisyphus 10.3.1-alt2)]


$ ansible-galaxy collection list community.general
usage: ansible-galaxy collection [-h] COLLECTION_ACTION ...
ansible-galaxy collection: error: argument COLLECTION_ACTION: invalid choice: 'list' (choose from 'init', 'build', 'publish', 'install')


Configuration

$ ansible-config dump --only-changed
-- nothing --

OS / Environment

OS Alt Server 10.1

Steps to Reproduce

  1. fakepkg 1.0 and fakepkg 2.0 in repo.

  2. Install fakepkg 1.0 manually -
    rpm -i /path/to/fakepkg-1.0.rpm (or apt-get install fakepkg=1.0)

  3. Create simple playbook

cat /tmp/apt_rpm.yml


- name: Playbook
  connection: local
  gather_facts: false
  hosts: localhost
  tasks:

  - name: Ensure fakepkg rpm present
    apt_rpm:
      pkg: fakepkg
      update_cache: true
      state: present

  1. apply
Using /etc/ansible/ansible.cfg as config file
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'

PLAY [Playbook] ***********************************

TASK [Ensure fakepkg rpm present] *****************************************
ok: [localhost] => {"changed": false, "msg": "Nothing to install"}

PLAY RECAP ************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   

Expected Results

fakepkg update from 1.0 to 2.0 version

Actual Results

rpm -q fakepkg
fakepkg-1.0-alt1.x86_64

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions