summaryrefslogtreecommitdiffstats
path: root/roles/subscription-manager
diff options
context:
space:
mode:
Diffstat (limited to 'roles/subscription-manager')
-rw-r--r--roles/subscription-manager/tasks/main.yml14
1 files changed, 13 insertions, 1 deletions
diff --git a/roles/subscription-manager/tasks/main.yml b/roles/subscription-manager/tasks/main.yml
index f3bd8b656..0b3aa351f 100644
--- a/roles/subscription-manager/tasks/main.yml
+++ b/roles/subscription-manager/tasks/main.yml
@@ -62,7 +62,7 @@
- rhsm_satellite|trim != ''
- name: "Register to Satellite using activation key"
- command: "/usr/bin/subscription-manager register --activationkey={{ rhsm_activationkey }} --org={{ rhsm_org }}"
+ command: "/usr/bin/subscription-manager register --activationkey={{ rhsm_activationkey }} --org='{{ rhsm_org }}'"
when:
- not registered
- rhsm_authentication == 'key'
@@ -77,6 +77,18 @@
when:
- not registered
- rhsm_authentication == "password"
+ - rhsm_org is not defined or rhsm_org is none or rhsm_org|trim == ''
+
+# This can apply to either Hosted or Satellite
+- name: "Register using username, password and organization"
+ command: "/usr/bin/subscription-manager register --username={{ rhsm_username }} --password={{ rhsm_password }} --org={{ rhsm_org }}"
+ no_log: true
+ when:
+ - not registered
+ - rhsm_authentication == "password"
+ - rhsm_org is defined
+ - rhsm_org is not none
+ - rhsm_org|trim != ''
- name: "Auto-attach to Subscription Manager Pool"
command: "/usr/bin/subscription-manager attach --auto"