ceph-ansible/roles/ceph-mon/tasks
Alexey Sheplyakov 76a3d876ee ceph-mon: fix the loop in `secure the cluster' task
Deployment fails when the ``secure_cluster`` is false:

TASK [ceph-mon : secure the cluster]
*******************************************
fatal: [saceph-mon.vm.ceph.asheplyakov]: FAILED! => {"failed": true, "msg": "'dict object' has no attribute 'stdout_lines'"}
fatal: [saceph-mon2.vm.ceph.asheplyakov]: FAILED! => {"failed": true, "msg": "'dict object' has no attribute 'stdout_lines'"}
fatal: [saceph-mon3.vm.ceph.asheplyakov]: FAILED! => {"failed": true, "msg": "'dict object' has no attribute 'stdout_lines'"}

A conditional include evaluates all included tasks with the (additional)
conditional applied to every task [1]. Thus all tasks from `secure_cluster.yml'
are always evaluated (with an additional 'when: secure_cluster' condition).
The `secure the cluster' task iterates over ``ceph_pools.stdout_lines``
even if ``secure_cluster`` is false: in loops ansible applies conditional
to every item (by design) [2]. However the `collect all the pools' task
is skipped if the very same condition evaluates to false, which leaves
the ``ceph_pools`` undefined, so the `secure the cluster' task fails:

Provide the default (empty) list to avoid the problem.

[1] http://docs.ansible.com/ansible/playbooks_conditionals.html#applying-when-to-roles-and-includes
[2] http://docs.ansible.com/ansible/playbooks_conditionals.html#loops-and-conditionals

Closes: #913

Signed-off-by: Alexey Sheplyakov <asheplyakov@mirantis.com>
2016-07-29 14:08:12 +03:00
..
docker Allow generating FSID for docker 2016-07-13 13:19:22 -04:00
calamari.yml create a calamari task in ceph-mon 2016-03-09 15:18:36 -05:00
ceph_keys.yml Unify formatting of when conditional 2016-05-09 14:08:33 +00:00
create_mds_filesystems.yml Updated version compare to 0.84.0 per laseb comment 2016-04-18 10:49:35 -04:00
deploy_monitors.yml Unify formatting of when conditional 2016-05-09 14:08:33 +00:00
main.yml Unify formatting of when conditional 2016-05-09 14:08:33 +00:00
openstack_config.yml ceph: implement cluster name support 2016-03-30 18:08:38 +02:00
secure_cluster.yml ceph-mon: fix the loop in `secure the cluster' task 2016-07-29 14:08:12 +03:00
start_monitor.yml ceph-mon: fix wrong indent 2016-06-09 15:35:57 +02:00