]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
site: use default value for 'cluster' variable
authorSébastien Han <seb@redhat.com>
Mon, 8 Oct 2018 13:45:58 +0000 (09:45 -0400)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Mon, 8 Oct 2018 20:31:32 +0000 (20:31 +0000)
If someone's cluster name is 'ceph' then the playbook will fail (with no
errors because of ignore_errors) saying it can not find the variable. So
let's declare the default. If the cluster name is different then it'll
be in group_vars and thus there won't be any failre.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1636962
Signed-off-by: Sébastien Han <seb@redhat.com>
site-docker.yml.sample
site.yml.sample

index 7d2e0fb7b582e9c0a304cdeb6fd80a5bd458009c..cba5cd89642685597382059d276f7f3555988289 100644 (file)
   become: True
   tasks:
     - name: get ceph status from the first monitor
-      command: docker exec ceph-mon-{{ hostvars[groups['mons'][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} -s
+      command: docker exec ceph-mon-{{ hostvars[groups['mons'][0]]['ansible_hostname'] }} ceph --cluster {{ cluster | default ('ceph') }} -s
       register: ceph_status
       changed_when: false
       delegate_to: "{{ groups['mons'][0] }}"
       run_once: true
       ignore_errors: true # we skip the error if mon_group_name is different than 'mons'
 
-    - name: "show ceph status for cluster {{ cluster }}"
+    - name: "show ceph status for cluster {{ cluster | default ('ceph') }}"
       debug:
         msg: "{{ ceph_status.stdout_lines }}"
       delegate_to: "{{ groups['mons'][0] }}"
index a8a4342ffef3d4aa9d6805927029cc81109d44dd..6ead1290af9466313ab8cce994baab3015cf0a1b 100644 (file)
   become: True
   tasks:
     - name: get ceph status from the first monitor
-      command: ceph --cluster {{ cluster }} -s
+      command: ceph --cluster {{ cluster | default ('ceph') }} -s
       register: ceph_status
       changed_when: false
       delegate_to: "{{ groups['mons'][0] }}"
       run_once: true
       ignore_errors: true # we skip the error if mon_group_name is different than 'mons'
 
-    - name: "show ceph status for cluster {{ cluster }}"
+    - name: "show ceph status for cluster {{ cluster | default ('ceph') }}"
       debug:
         msg: "{{ ceph_status.stdout_lines }}"
       delegate_to: "{{ groups['mons'][0] }}"