ceph-ansible/roles/ceph-mon
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
..
defaults Support for docker image tags 2016-07-12 15:49:07 -07:00
files/precise Rename roles' names 2014-07-08 15:39:42 +02:00
meta wip: galaxy roles dependencies 2016-03-02 13:52:56 +01:00
tasks ceph-mon: fix the loop in `secure the cluster' task 2016-07-29 14:08:12 +03:00
templates Support for docker image tags 2016-07-12 15:49:07 -07:00
LICENSE Add READMEs for each roles 2015-07-25 10:51:53 +02:00
README.md Add contribution note 2015-07-25 11:10:39 +02:00

README.md

Ansible role: Ceph Monitor

This role mainly bootstraps Ceph monitor(s) but also has several capabilities:

  • Deploys Ceph monitor(s)
  • Manages Ceph keys
  • Can create OpenStack pools, users and keys
  • Secures a cluster (protect pools)
  • Bootstraps dockerized Ceph monitors

Requirements

Nothing, it runs out of the box.

Role variables

Have a look at: defaults/main.yml.

Mandatory variables

None.

Dependencies

The role leseb.ceph-common must be installed.

Example Playbook

- hosts: servers
  remote_user: ubuntu
  roles:
     - { role: leseb.ceph-mon }

Contribution

THIS REPOSITORY DOES NOT ACCEPT PULL REQUESTS PULL REQUESTS MUST GO THROUGH CEPH-ANSIBLE

License

Apache

Author Information

This role was created by Sébastien Han.