summaryrefslogtreecommitdiffstats
path: root/roles
diff options
context:
space:
mode:
Diffstat (limited to 'roles')
-rw-r--r--roles/subscription-manager/tasks/main.yml9
1 files changed, 7 insertions, 2 deletions
diff --git a/roles/subscription-manager/tasks/main.yml b/roles/subscription-manager/tasks/main.yml
index 78ceaccd1..414bf8f7a 100644
--- a/roles/subscription-manager/tasks/main.yml
+++ b/roles/subscription-manager/tasks/main.yml
@@ -1,4 +1,5 @@
---
+
- name: Initializing Subscription Manager authenticaiton method
set_fact:
rhsm_authentication: false
@@ -61,6 +62,7 @@
- rhsm_satellite|trim != ''
# This can apply to either Hosted or Satellite
+
- name: Register using username and password
command: "/usr/bin/subscription-manager register --username={{ rhsm_username }} --password={{ rhsm_password }}"
when:
@@ -72,12 +74,15 @@
when:
- not registered
- rhsm_authentication != "key"
+ - rhsm_pool is undefined or rhsm_pool is none or rhsm_pool|trim == ''
- name: Attach to a specific pool
command: "/usr/bin/subscription-manager attach --pool={{ rhsm_pool }}"
when:
- - rhsm_pool is defined and rhsm_pool is not none and rhsm_pool|trim != ''
- - and not registered
+ - rhsm_pool is defined
+ - rhsm_pool is not none
+ - rhsm_pool|trim != ''
+ - not registered
- rhsm_authentication != "key"
- name: Disable all repositories