Bug 1392962 - [ceph-ansible]: rolling_update.yml fails on a 1 MON cluster setup
Summary: [ceph-ansible]: rolling_update.yml fails on a 1 MON cluster setup
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Storage Console
Classification: Red Hat
Component: ceph-ansible
Version: 2
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
: 3
Assignee: Alfredo Deza
QA Contact: ceph-qe-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-08 14:43 UTC by Tejas
Modified: 2016-11-08 16:06 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-08 14:47:44 UTC
Target Upstream Version:


Attachments (Terms of Use)
ansible playbook log (24.16 KB, text/plain)
2016-11-08 14:43 UTC, Tejas
no flags Details

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.


Note You need to log in before you can comment on or make changes to this bug.