foreman-ansible-modules icon indicating copy to clipboard operation
foreman-ansible-modules copied to clipboard

Local Product Subscription IDs are not Found Unless State=Present

Open jamesmarshall24 opened this issue 3 years ago • 3 comments

SUMMARY

Local products return "Found no results while searching for subscriptions with id=redact" when state is not explicitly provided as "present" for activation_key module

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible-playbook 2.9.18
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/var/lib/awx/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible-playbook
  python version = 2.7.5 (default, Aug 13 2020, 02:51:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
COLLECTION VERSION
v2.1.1
KATELLO/FOREMAN VERSION
katello-3.14.0-6.el7sat.noarch
STEPS TO REPRODUCE
- name: "Update activaton key"
  redhat.satellite.activation_key:
      username: "api"
      password: "redact"
      server_url: "redact"
      name: "RHELredact"
      organization: "{{ ORG }}"
      lifecycle_environment: "redact"
      content_view: "redact"
      host_collections: "redact"
      content_overrides: "{{ lookup(redact) }}"
      subscriptions: "{{ lookup(redact) }}"
      auto_attach: False
      release_version: 7Server
      unlimited_hosts: yes
      service_level: Premium
      validate_certs: no
  with_nested:
      - redact
  register: update_activation_key
EXPECTED RESULTS

Pool ID found for local products

ACTUAL RESULTS
"msg": "Found no results while searching for subscriptions with id="redact"

Listing the subscriptions show the subscription ID.

Adding "state: present" resolves the issue although that should be the default value.

jamesmarshall24 avatar Jul 01 '21 00:07 jamesmarshall24

It's a bit hard to debug if all your data is "redact"

Can you please send the real playbook and the real output to [email protected]? thanks.

evgeni avatar Jul 01 '21 08:07 evgeni

@evgeni sent

jamesmarshall24 avatar Jul 01 '21 23:07 jamesmarshall24

I got the data, but by the love of god don't see how this should fail in that environment :(

Could you get me the output of the following playbook please?

      - name: get sub info
        redhat.satellite.subscription_info:
          username: "{{ foreman_username }}"
          password: "{{ foreman_password }}"
          server_url: "{{ foreman_url }}"
          validate_certs: "{{ foreman_validate_certs }}"
          organization: "{{ foreman_organization }}"
        register: subs
  
      - debug:
          var: subs

(fill out the vars as needed, obviously ;))

evgeni avatar Jul 08 '21 12:07 evgeni