Bug 1392962

Summary: [ceph-ansible]: rolling_update.yml fails on a 1 MON cluster setup
Product: Red Hat Storage Console Reporter: Tejas <tchandra>
Component: ceph-ansibleAssignee: Alfredo Deza <adeza>
Status: CLOSED NOTABUG QA Contact: ceph-qe-bugs <ceph-qe-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 2CC: adeza, aschoen, ceph-eng-bugs, gmeno, kdreyer, nthomas, sankarshan, seb
Target Milestone: ---   
Target Release: 3   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-08 14:47:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
ansible playbook log none

Description Tejas 2016-11-08 14:43:34 UTC
Created attachment 1218543 [details]
ansible playbook  log

Description of problem:
    On a cluster having 1 mon, the rolling_update.yml fails:

TASK: [waiting for the monitor to join the quorum...] ************************* 
fatal: [magna003 -> {{ mon_host }}] => Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 586, in _executor
    exec_rc = self._executor_internal(host, new_stdin)
  File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 789, in _executor_internal
    return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
  File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 927, in _executor_internal_inner
    delegate = self._compute_delegate(actual_pass, inject)
  File "/usr/lib/python2.7/site-packages/ansible/runner/__init__.py", line 363, in _compute_delegate
    fail_on_undefined=True
  File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 124, in template
    varname = template_from_string(basedir, varname, templatevars, fail_on_undefined)
  File "/usr/lib/python2.7/site-packages/ansible/utils/template.py", line 382, in template_from_string
    res = jinja2.utils.concat(rf)
  File "<template>", line 8, in root
  File "/usr/lib/python2.7/site-packages/jinja2/runtime.py", line 485, in _fail_with_undefined_error
    raise self._undefined_exception(hint)
UndefinedError: 'mon_host' is undefined


Version-Release number of selected component (if applicable):
ceph-ansible-1.0.5-39.el7scon.noarch

How reproducible:
Always



Additional info:

- name: select a running monitor
      set_fact: mon_host={{ item }}
      with_items: groups.mons
      when: item != inventory_hostname

    - name: waiting for the monitor to join the quorum...
      shell: |
        ceph -s  --cluster {{ cluster }} | grep monmap | sed 's/.*quorum//' | egrep -sq {{ ansible_hostname }}
      register: result
      until: result.rc == 0
      retries: "{{ health_mon_check_retries }}"
      delay: "{{ health_mon_check_delay }}"
      delegate_to: "{{ mon_host }}"


When the playbook selects a monitor, it picks a monitor other than the one being updated. So when there is just one MON, it failes saying there is no mon defined.



Attaching the playbook log here.

Comment 2 seb 2016-11-08 14:47:44 UTC
A single monitor is not supported a configuration thus ut should never be tested.