From d29f647f094c177b30067eed08e370a8cd25332c Mon Sep 17 00:00:00 2001 From: Giuseppe Mancuso Date: Fri, 14 Dec 2018 18:27:58 +0100 Subject: [PATCH] issue with activation_key and proxy on subscription-manager (#42624) * Update redhat_subscription.py I need to use a proxy server/user/password also if I user an activation_key * remove spaces --- .../modules/packaging/os/redhat_subscription.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/ansible/modules/packaging/os/redhat_subscription.py b/lib/ansible/modules/packaging/os/redhat_subscription.py index 6f02c091e75..514c3f088da 100644 --- a/lib/ansible/modules/packaging/os/redhat_subscription.py +++ b/lib/ansible/modules/packaging/os/redhat_subscription.py @@ -348,6 +348,15 @@ class Rhsm(RegistrationBase): if org_id: args.extend(['--org', org_id]) + if server_proxy_hostname and server_proxy_port: + args.extend(['--proxy', server_proxy_hostname + ':' + server_proxy_port]) + + if server_proxy_user: + args.extend(['--proxyuser', server_proxy_user]) + + if server_proxy_password: + args.extend(['--proxypassword', server_proxy_password]) + if activationkey: args.extend(['--activationkey', activationkey]) else: @@ -365,12 +374,6 @@ class Rhsm(RegistrationBase): args.extend(['--consumerid', consumer_id]) if environment: args.extend(['--environment', environment]) - if server_proxy_hostname and server_proxy_port: - args.extend(['--proxy', server_proxy_hostname + ':' + server_proxy_port]) - if server_proxy_user: - args.extend(['--proxyuser', server_proxy_user]) - if server_proxy_password: - args.extend(['--proxypassword', server_proxy_password]) if release: args.extend(['--release', release])