1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

redhat_subscription: don't discard vars with key (#5627)

Fixes #3486. From the man-pages of subscription-manager, none of the
parameters used are tied to the activationkey except the two that remain
in its else-clause.

Note that type is not mentioned in the man-pages on 7.6 (at least), but
is still present and available.

Co-authored-by: Thor K. H <thor@roht.no>
This commit is contained in:
Pino Toscano 2022-11-30 22:15:55 +01:00 committed by GitHub
parent 101c957631
commit f7fa54eed9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 10 deletions

View file

@ -0,0 +1,3 @@
bugfixes:
- redhat_subscription - do not ignore ``consumer_name`` and other variables if ``activationkey`` is specified
(https://github.com/ansible-collections/community.general/issues/3486, https://github.com/ansible-collections/community.general/pull/5627).

View file

@ -411,23 +411,28 @@ class Rhsm(RegistrationBase):
if org_id:
args.extend(['--org', org_id])
if auto_attach:
args.append('--auto-attach')
if consumer_type:
args.extend(['--type', consumer_type])
if consumer_name:
args.extend(['--name', consumer_name])
if consumer_id:
args.extend(['--consumerid', consumer_id])
if environment:
args.extend(['--environment', environment])
if activationkey:
args.extend(['--activationkey', activationkey])
else:
if auto_attach:
args.append('--auto-attach')
if username:
args.extend(['--username', username])
if password:
args.extend(['--password', password])
if consumer_type:
args.extend(['--type', consumer_type])
if consumer_name:
args.extend(['--name', consumer_name])
if consumer_id:
args.extend(['--consumerid', consumer_id])
if environment:
args.extend(['--environment', environment])
if release:
args.extend(['--release', release])