summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2015-06-30 05:07:29 -0700
committerToshio Kuratomi <a.badger@gmail.com>2015-06-30 05:07:29 -0700
commit6b8e6c0a0a9f75e406b1c9823ec579ad4468a42c (patch)
treed38399db3e0b34e2d2260af6d729a8fb50814df6
parent02ea210db9f60ab68b5ae4e18f7150f3e5993954 (diff)
parentcda40bc33c0da4444bd83ba527b198545ff99085 (diff)
downloadansible-modules-core-6b8e6c0a0a9f75e406b1c9823ec579ad4468a42c.tar.gz
Merge pull request #425 from gerhardsam/devel
rhn_register: add support for profilename
-rw-r--r--packaging/os/rhn_register.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/packaging/os/rhn_register.py b/packaging/os/rhn_register.py
index 1e92405c..4207acc8 100644
--- a/packaging/os/rhn_register.py
+++ b/packaging/os/rhn_register.py
@@ -56,6 +56,11 @@ options:
- supply an activation key for use with registration
required: False
default: null
+ profilename:
+ description:
+ - supply an profilename for use with registration
+ required: False
+ default: null
channels:
description:
- Optionally specify a list of comma-separated channels to subscribe to upon successful registration.
@@ -73,6 +78,9 @@ EXAMPLES = '''
# Register with activationkey (1-222333444) and enable extended update support.
- rhn_register: state=present activationkey=1-222333444 enable_eus=true
+# Register with activationkey (1-222333444) and set a profilename which may differ from the hostname.
+- rhn_register: state=present activationkey=1-222333444 profilename=host.example.com.custom
+
# Register as user (joe_user) with password (somepass) against a satellite
# server specified by (server_url).
- rhn_register: >
@@ -209,7 +217,7 @@ class Rhn(RegistrationBase):
self.update_plugin_conf('rhnplugin', True)
self.update_plugin_conf('subscription-manager', False)
- def register(self, enable_eus=False, activationkey=None):
+ def register(self, enable_eus=False, activationkey=None, profilename=None):
'''
Register system to RHN. If enable_eus=True, extended update
support will be requested.
@@ -221,7 +229,8 @@ class Rhn(RegistrationBase):
register_cmd += " --use-eus-channel"
if activationkey is not None:
register_cmd += " --activationkey '%s'" % activationkey
- # FIXME - support --profilename
+ if profilename is not None:
+ register_cmd += " --profilename '%s'" % profilename
# FIXME - support --systemorgid
rc, stdout, stderr = self.module.run_command(register_cmd, check_rc=True, use_unsafe_shell=True)
@@ -285,6 +294,7 @@ def main():
password = dict(default=None, required=False),
server_url = dict(default=rhn.config.get_option('serverURL'), required=False),
activationkey = dict(default=None, required=False),
+ profilename = dict(default=None, required=False),
enable_eus = dict(default=False, type='bool'),
channels = dict(default=[], type='list'),
)
@@ -295,6 +305,7 @@ def main():
rhn.password = module.params['password']
rhn.configure(module.params['server_url'])
activationkey = module.params['activationkey']
+ profilename = module.params['profilename']
channels = module.params['channels']
rhn.module = module