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

Suse 15.3 - when removing all products, second deregistration will fail #11

Open
DanSibbernsen opened this issue Mar 1, 2022 · 1 comment
Assignees

Comments

@DanSibbernsen
Copy link

After executing this role with no products listed, re-running it will fail because SUSEConnect -s returns the base package as Not Registered. It will attempt to register SLES but will not have a key, failing the role.

tasks-line60

- name: Add Subscriptions
  command: |
    {{ suseconnect_binary }} -p
    {{- item['product'] | default(ansible_distribution) }}/
    {{- item['version'] | default(ansible_distribution_version) }}/
    {{- item['arch'] | default(ansible_machine) }}
    {%- if item['key'] is defined %} -r {{ item['key'] }}{% endif %}
  when:
    - ( suseconnect_status[item['product'] | default(ansible_distribution)] is not defined or
      ( suseconnect_status[item['product'] | default(ansible_distribution)]['status'] != 'Registered' or
      ( item['version'] is defined and suseconnect_status[item['product'] | default(ansible_distribution)]['version']|string != item['version']|string ))) or
      suseconnect_reregister
  with_items: "{{ suseconnect_products }}"

Specifically, this line in the when:

      ( suseconnect_status[item['product'] | default(ansible_distribution)]['status'] != 'Registered' or

I think, if we have no products listed, we should assume the intent is to remove this box from the SUSE registration, and "Add Subscriptions" should be skipped over. Does that make sense?

@netzvieh
Copy link
Member

Hi Dan, thanks for your question. I'll haven't needed this role in some time and will have to think about that. I'll get back to this issue in a short while!

@netzvieh netzvieh self-assigned this Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants