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])