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: replace deprecated autosubscribe (#30927)

This commit is contained in:
Martin Krizek 2017-09-27 08:33:00 +02:00 committed by ansibot
parent 91bb211922
commit 55739c1e46

View file

@ -81,11 +81,15 @@ options:
required: False
default: Current value from C(/etc/rhsm/rhsm.conf) is the default
version_added: "2.4"
autosubscribe:
auto_attach:
description:
- Upon successful registration, auto-consume available subscriptions
- Added in favor of depracated autosubscribe in 2.5.
required: False
default: False
type: bool
version_added: "2.5"
aliases: [autosubscribe]
activationkey:
description:
- supply an activation key for use with registration
@ -156,7 +160,7 @@ EXAMPLES = '''
state: present
username: joe_user
password: somepass
autosubscribe: true
auto_attach: true
- name: Same as above but subscribe to a specific pool by ID.
redhat_subscription:
@ -210,7 +214,7 @@ EXAMPLES = '''
username: joe_user
password: somepass
environment: Library
autosubscribe: yes
auto_attach: true
'''
RETURN = '''
@ -357,7 +361,7 @@ class Rhsm(RegistrationBase):
else:
return False
def register(self, username, password, autosubscribe, activationkey, org_id,
def register(self, username, password, auto_attach, activationkey, org_id,
consumer_type, consumer_name, consumer_id, force_register, environment,
rhsm_baseurl, server_insecure, server_hostname, server_proxy_hostname,
server_proxy_port, server_proxy_user, server_proxy_password):
@ -385,8 +389,8 @@ class Rhsm(RegistrationBase):
args.extend(['--activationkey', activationkey])
args.extend(['--org', org_id])
else:
if autosubscribe:
args.append('--autosubscribe')
if auto_attach:
args.append('--auto-attach')
if username:
args.extend(['--username', username])
if password:
@ -669,8 +673,7 @@ def main():
required=False),
rhsm_baseurl=dict(default=rhsm.config.get_option('rhsm.baseurl'),
required=False),
autosubscribe=dict(default=False,
type='bool'),
auto_attach=dict(aliases=['autosubscribe'], default=False, type='bool'),
activationkey=dict(default=None,
required=False),
org_id=dict(default=None,
@ -714,7 +717,7 @@ def main():
server_hostname = module.params['server_hostname']
server_insecure = module.params['server_insecure']
rhsm_baseurl = module.params['rhsm_baseurl']
autosubscribe = module.params['autosubscribe']
auto_attach = module.params['auto_attach']
activationkey = module.params['activationkey']
org_id = module.params['org_id']
environment = module.params['environment']
@ -762,7 +765,7 @@ def main():
try:
rhsm.enable()
rhsm.configure(**module.params)
rhsm.register(username, password, autosubscribe, activationkey, org_id,
rhsm.register(username, password, auto_attach, activationkey, org_id,
consumer_type, consumer_name, consumer_id, force_register,
environment, rhsm_baseurl, server_insecure, server_hostname,
server_proxy_hostname, server_proxy_port, server_proxy_user, server_proxy_password)