tests: Skip role if ceph_mons list is empty

The role execution only makes sense if we are configuring a node as a
Ceph monitor so we can skip all the task inclusions if this list is
empty.

Change-Id: I8155bf199a99912527a50b98dfe916b8b2d9b23e
This commit is contained in:
Markos Chandras 2018-11-05 12:08:06 +00:00
parent f2772bd0eb
commit 54f74e29a9

View File

@ -13,6 +13,13 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
- name: End playbook if disabled
meta: end_play
when:
- ceph_mons | list | length == 0
tags:
- always
- name: Gather variables for each operating system - name: Gather variables for each operating system
include_vars: "{{ item }}" include_vars: "{{ item }}"
with_first_found: with_first_found:
@ -26,45 +33,30 @@
- include_tasks: "ceph_preinstall_{{ ansible_pkg_mgr }}.yml" - include_tasks: "ceph_preinstall_{{ ansible_pkg_mgr }}.yml"
when: when:
- ceph_mons != []
- ceph_mons | list == ceph_mons
- ceph_pkg_source != 'distro' - ceph_pkg_source != 'distro'
tags: tags:
- ceph-install - ceph-install
- include_tasks: ceph_install.yml - include_tasks: ceph_install.yml
when:
- ceph_mons != []
- ceph_mons | list == ceph_mons
tags: tags:
- ceph-install - ceph-install
- include_tasks: ceph_install_python_libs.yml - include_tasks: ceph_install_python_libs.yml
when: when:
- ceph_mons != []
- ceph_mons | list == ceph_mons
- openstack_service_venv_bin != '' - openstack_service_venv_bin != ''
tags: tags:
- ceph-install - ceph-install
- include_tasks: ceph_get_mon_host.yml - include_tasks: ceph_get_mon_host.yml
when:
- ceph_mons != []
- ceph_mons | list == ceph_mons
tags: tags:
- ceph-config - ceph-config
- include_tasks: ceph_config.yml - include_tasks: ceph_config.yml
when:
- ceph_mons != []
- ceph_mons | list == ceph_mons
tags: tags:
- ceph-config - ceph-config
- include_tasks: ceph_auth.yml - include_tasks: ceph_auth.yml
when: when:
- cephx | bool - cephx | bool
- ceph_mons != []
- ceph_mons | list == ceph_mons
tags: tags:
- ceph-config - ceph-config