mirror of https://github.com/ceph/ceph-ansible.git
site: use default value for 'cluster' variable
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>pull/3205/head
parent
9180f6a277
commit
82ec5a29f2
|
@ -374,14 +374,14 @@
|
||||||
become: True
|
become: True
|
||||||
tasks:
|
tasks:
|
||||||
- name: get ceph status from the first monitor
|
- 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
|
register: ceph_status
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups['mons'][0] }}"
|
delegate_to: "{{ groups['mons'][0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
ignore_errors: true # we skip the error if mon_group_name is different than 'mons'
|
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:
|
debug:
|
||||||
msg: "{{ ceph_status.stdout_lines }}"
|
msg: "{{ ceph_status.stdout_lines }}"
|
||||||
delegate_to: "{{ groups['mons'][0] }}"
|
delegate_to: "{{ groups['mons'][0] }}"
|
||||||
|
|
|
@ -408,14 +408,14 @@
|
||||||
become: True
|
become: True
|
||||||
tasks:
|
tasks:
|
||||||
- name: get ceph status from the first monitor
|
- name: get ceph status from the first monitor
|
||||||
command: ceph --cluster {{ cluster }} -s
|
command: ceph --cluster {{ cluster | default ('ceph') }} -s
|
||||||
register: ceph_status
|
register: ceph_status
|
||||||
changed_when: false
|
changed_when: false
|
||||||
delegate_to: "{{ groups['mons'][0] }}"
|
delegate_to: "{{ groups['mons'][0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
ignore_errors: true # we skip the error if mon_group_name is different than 'mons'
|
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:
|
debug:
|
||||||
msg: "{{ ceph_status.stdout_lines }}"
|
msg: "{{ ceph_status.stdout_lines }}"
|
||||||
delegate_to: "{{ groups['mons'][0] }}"
|
delegate_to: "{{ groups['mons'][0] }}"
|
||||||
|
|
Loading…
Reference in New Issue