diff options
author | Vinny Valdez <vvaldez@redhat.com> | 2016-04-05 18:17:36 -0500 |
---|---|---|
committer | Vinny Valdez <vvaldez@redhat.com> | 2016-04-20 09:28:48 -0500 |
commit | 96aaa6df25774e05cda3e4a6f73b030ae989100a (patch) | |
tree | 65078d9c283e43e318c7c255a5ffe22fce460097 /roles/subscription-manager/tasks | |
parent | 644f1e672c80bd10f34fabafcfe805c306e77b5e (diff) | |
download | openshift-96aaa6df25774e05cda3e4a6f73b030ae989100a.tar.gz openshift-96aaa6df25774e05cda3e4a6f73b030ae989100a.tar.bz2 openshift-96aaa6df25774e05cda3e4a6f73b030ae989100a.tar.xz openshift-96aaa6df25774e05cda3e4a6f73b030ae989100a.zip |
Refactor use of rhsm_password to prevent display to CLI
Diffstat (limited to 'roles/subscription-manager/tasks')
-rw-r--r-- | roles/subscription-manager/tasks/main.yml | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/roles/subscription-manager/tasks/main.yml b/roles/subscription-manager/tasks/main.yml index 414bf8f7a..6e51be7e4 100644 --- a/roles/subscription-manager/tasks/main.yml +++ b/roles/subscription-manager/tasks/main.yml @@ -1,5 +1,12 @@ --- - +- name: Initialize rhsm_password variable if vars_prompt was used + set_fact: + rhsm_password: "{{ hostvars.localhost.rhsm_password }}" + when: + - rhsm_password is defined + - rhsm_password is not none + - rhsm_password|trim != '' + - name: Initializing Subscription Manager authenticaiton method set_fact: rhsm_authentication: false @@ -19,8 +26,12 @@ set_fact: rhsm_authentication: "password" when: - - rhsm_username is defined and rhsm_username is not none and rhsm_username|trim != '' - - rhsm_password is defined and rhsm_password is not none and rhsm_password|trim != '' + - rhsm_username is defined + - rhsm_username is not none + - rhsm_username|trim != '' + - rhsm_password is defined + - rhsm_password is not none + - rhsm_password|trim != '' - not rhsm_authentication - name: Initializing registration status @@ -62,18 +73,17 @@ - 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 }}" + no_log: true when: - not registered - - rhsm_authentication != "key" + - rhsm_authentication == "password" - name: Auto-attach to Subscription Manager Pool command: "/usr/bin/subscription-manager attach --auto" 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 @@ -83,7 +93,6 @@ - rhsm_pool is not none - rhsm_pool|trim != '' - not registered - - rhsm_authentication != "key" - name: Disable all repositories command: "/usr/bin/subscription-manager repos --disable=*" |