From 3c6e156d0846ee392eda3b39d5e36bdd7a86d305 Mon Sep 17 00:00:00 2001 From: tynorth-cisco Date: Tue, 13 Dec 2016 16:48:14 -0800 Subject: [PATCH] Change attribute call to .get call in ceph keys If previous check was not run, .stdout_lines is not a valid key on the dictionary. To get around this, use .get("stdout_lines") instead. Also add in a default empty list --- roles/ceph-mon/tasks/ceph_keys.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-mon/tasks/ceph_keys.yml b/roles/ceph-mon/tasks/ceph_keys.yml index 58d026847..be87f9828 100644 --- a/roles/ceph-mon/tasks/ceph_keys.yml +++ b/roles/ceph-mon/tasks/ceph_keys.yml @@ -35,7 +35,7 @@ owner: "{{ key_owner }}" group: "{{ key_group }}" with_items: - - "{{ ceph_keys.stdout_lines }}" + - "{{ ceph_keys.get('stdout_lines') | default([]) }}" when: cephx - name: copy keys to the ansible server @@ -45,7 +45,7 @@ flat: yes run_once: true with_items: - - "{{ ceph_keys.stdout_lines }}" + - "{{ ceph_keys.get('stdout_lines') | default([]) }}" - /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring