]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
Fix logic of finding entitlements.yml
authorZack Cerza <zack@redhat.com>
Tue, 14 Jul 2015 00:59:54 +0000 (18:59 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 14 Jul 2015 16:38:15 +0000 (10:38 -0600)
We were mistakenly checking for the existence of entitlements.yml on the
*remote* end.

Signed-off-by: Zack Cerza <zack@redhat.com>
roles/common/tasks/rhel-entitlements.yml

index 8595efadb166a2b799f21055f65afc0739d4c89c..6679468a992ec54c877071430edc6c91d342395c 100644 (file)
@@ -5,17 +5,18 @@
   set_fact:
     entitlements_path: "{{ secrets_path | mandatory }}/entitlements.yml"
 
-- name: Check for existence of entitlements_path
-  stat:
-    path: "{{ entitlements_path }}"
-  register: entitlements
-
 - name: Include Red Hat encrypted variables.
-  include_vars: "{{ entitlements_path }}"
+  include_vars: "{{ item }}"
+  with_first_found:
+    - "{{ entitlements_path }}"
+    - empty.yml
   no_log: true
   tags:
     - vars
-  when: entitlements.stat.exists
+
+- name: Set have_entitlements
+  set_fact:
+    have_entitlements: "{{ subscription_manager_org != '' and subscription_manager_activationkey != ''}}"
 
 - name: Determine if node is registered with subscription-manager.
   command: subscription-manager identity
@@ -33,7 +34,7 @@
            --activationkey={{ subscription_manager_activationkey }}
            --org={{ subscription_manager_org }}
   no_log: true
-  when: rhsm_registered == "False" and entitlements.stat.exists
+  when: rhsm_registered == "False" and have_entitlements == "True"
   register: entitled
   until: entitled|success
   retries: 5