From 9d8c1923ab669681230c3f87b839016f3e57da08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Boraty=C5=84ski?= Date: Thu, 26 Jan 2017 19:28:24 +0100 Subject: [PATCH] [redhat_subscription]: fixed force option. (#20667) `force` option is not unique for non-activationkey registrations and it should be parsed separately; it is possible to register host with activation key and force such process. --- lib/ansible/modules/packaging/os/redhat_subscription.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/packaging/os/redhat_subscription.py b/lib/ansible/modules/packaging/os/redhat_subscription.py index e0fbe01642e..c1a4324d7b1 100644 --- a/lib/ansible/modules/packaging/os/redhat_subscription.py +++ b/lib/ansible/modules/packaging/os/redhat_subscription.py @@ -292,6 +292,9 @@ class Rhsm(RegistrationBase): args = [SUBMAN_CMD, 'register'] # Generate command arguments + if force_register: + args.extend(['--force']) + if activationkey: args.extend(['--activationkey', activationkey]) args.extend(['--org', org_id]) @@ -308,8 +311,6 @@ class Rhsm(RegistrationBase): args.extend(['--name', consumer_name]) if consumer_id: args.extend(['--consumerid', consumer_id]) - if force_register: - args.extend(['--force']) if environment: args.extend(['--environment', environment])