Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redhat_subscription module is not idempotent when pool_ids are used #5313

Closed
1 task done
cfiehe opened this issue Sep 26, 2022 · 2 comments
Closed
1 task done

redhat_subscription module is not idempotent when pool_ids are used #5313

cfiehe opened this issue Sep 26, 2022 · 2 comments
Labels
bug This issue/PR relates to a bug module module os packaging plugins plugin (any type)

Comments

@cfiehe
Copy link
Contributor

cfiehe commented Sep 26, 2022

Summary

When you provide some pool_ids, the module reports a change every time when it runs. The current entitements get removed and recreated afterwards:

- name: subscription | Ensure subscription
  community.general.redhat_subscription:
    state: present
    username: joe_user
    password: somepass
    pool_ids: 0123456789abcdef0123456789abcdef

Every run results in

TASK [rhsm : subscription | Ensure subscription] *************************
changed: [molecule-rhel-9.<my_company>]

Issue Type

Bug Report

Component Name

redhat_subscription

Ansible Version

$ ansible --version
ansible [core 2.13.3]
  config file = None
  configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ansible/.local/lib/python3.10/site-packages/ansible
  ansible collection location = /home/ansible/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ansible/.local/bin/ansible
  python version = 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0]
  jinja version = 3.0.3
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
Collection        Version
----------------- -------
community.general 5.5.0

Configuration

$ ansible-config dump --only-changed
$

OS / Environment

RHEL 9

Steps to Reproduce

---
- hosts: localhost
  tasks:
  - name: subscription | Ensure subscription
    community.general.redhat_subscription:
      state: present
      username: joe_user
      password: somepass
      pool_ids: 0123456789abcdef0123456789abcdef

Expected Results

After the system has been registered and properly subscribed, the module should report no further change an keep the current entitlements untouched.

Actual Results

TASK [rhsm : subscription | Ensure subscription] *************************
changed: [molecule-rhel-9.<my_company>]

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module os packaging plugins plugin (any type) labels Sep 26, 2022
cfiehe added a commit to cfiehe/community.general that referenced this issue Sep 26, 2022
This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe added a commit to cfiehe/community.general that referenced this issue Sep 26, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Sep 26, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Sep 29, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Oct 2, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Oct 2, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Oct 3, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Oct 3, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
cfiehe pushed a commit to cfiehe/community.general that referenced this issue Oct 3, 2022
…otent when pool_ids

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>
patchback bot pushed a commit that referenced this issue Oct 3, 2022
…#5319)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
(cherry picked from commit 6fe2a84)
patchback bot pushed a commit that referenced this issue Oct 3, 2022
…#5319)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
(cherry picked from commit 6fe2a84)
felixfontein pushed a commit that referenced this issue Oct 3, 2022
…#5319) (#5329)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
(cherry picked from commit 6fe2a84)

Co-authored-by: cfiehe <[email protected]>
felixfontein pushed a commit that referenced this issue Oct 3, 2022
…#5319) (#5330)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
(cherry picked from commit 6fe2a84)

Co-authored-by: cfiehe <[email protected]>
v1v added a commit to v1v/community.general that referenced this issue Oct 7, 2022
* upstream/main: (203 commits)
  Make pfexec become usable for illumos (ansible-collections#3889)
  znode: add options for authentication (ansible-collections#5306)
  keycloak_user_federation: add explanation and example to vendor option (ansible-collections#4893)
  Next expected release is 5.8.0.
  Allow terraform module to specify complex variable structures (ansible-collections#4797)
  Fix ansible-collections#5313: redhat_subscription module is not idempotent when pool_ids (ansible-collections#5319)
  bitwarden: Add field to search for all item attributes, instead of on… (ansible-collections#5297)
  New Module: Keycloak User Rolemapping (ansible-collections#4898)
  chore: Update lxc_container to support py3 (ansible-collections#5304)
  terraform: run `init` with no-color, too (ansible-collections#5147)
  nmcli: fix error when setting previously unset mac address (ansible-collections#5291)
  [feat] proxmox_snap: snapshot containers with configured mountpoints (ansible-collections#5274)
  machinectl: include the success command (ansible-collections#5287)
  Add SetSessionService to redfish_config (ansible-collections#5009)
  locale_gen: fix UbuntuMode (ansible-collections#5282)
  ini_file: fix lint error (ansible-collections#5307)
  netcup_dnsapi: Add timeout paramter (ansible-collections#5301)
  stable-2.14 is now default.
  Add stable-2.14 to CI, adjust to devel version bump (ansible-collections#5298)
  Try to run reuse workflow without explicitly allowing it for new contributors. (ansible-collections#5296)
  ...
bratwurzt pushed a commit to bratwurzt/community.general that referenced this issue Nov 7, 2022
…otent when pool_ids (ansible-collections#5319)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
bratwurzt pushed a commit to bratwurzt/community.general that referenced this issue Nov 7, 2022
…otent when pool_ids (ansible-collections#5319)

This fix ensures the idempotency of the redhat_subscription module when pool_ids are used. The main problem was, that a 'None' quantity was not properly handled and that the quantity check compared a string with an integer.

Signed-off-by: Christoph Fiehe <[email protected]>

Signed-off-by: Christoph Fiehe <[email protected]>
Co-authored-by: Christoph Fiehe <[email protected]>
This was referenced Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module os packaging plugins plugin (any type)
Projects
None yet
Development

No branches or pull requests

2 participants