From 2bcaf9088b5d19b815dcde30a0e25adabbd37fd1 Mon Sep 17 00:00:00 2001 From: Guillaume Abrioux Date: Fri, 19 Oct 2018 15:52:28 +0200 Subject: [PATCH] docker-common: remove duplicate running cluster check this is already done in ceph-defaults, there is no need to have this check in ceph-docker-common. Signed-off-by: Guillaume Abrioux --- roles/ceph-docker-common/tasks/checks.yml | 2 +- roles/ceph-docker-common/tasks/main.yml | 15 +-------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/roles/ceph-docker-common/tasks/checks.yml b/roles/ceph-docker-common/tasks/checks.yml index 8bfa16a8b..b0b978e01 100644 --- a/roles/ceph-docker-common/tasks/checks.yml +++ b/roles/ceph-docker-common/tasks/checks.yml @@ -11,4 +11,4 @@ when: - inventory_hostname == groups.get(mon_group_name) - item.1.stat.exists - - ceph_health.stdout_lines | length == 0 + - not ceph_current_status.get('rc', 1) == 0 diff --git a/roles/ceph-docker-common/tasks/main.yml b/roles/ceph-docker-common/tasks/main.yml index 14fe9ae6c..f2e621a32 100644 --- a/roles/ceph-docker-common/tasks/main.yml +++ b/roles/ceph-docker-common/tasks/main.yml @@ -20,19 +20,6 @@ set_fact: ceph_docker_version: "{{ ceph_docker_version.stdout.split(' ')[2] }}" -# Only include 'checks.yml' when : -# we are deploying containers without kv AND host is either a mon OR a nfs OR an osd, -# AND -# a cluster is not already running, -# AND -# we are not playing rolling-update.yml playbook. -- name: check if a cluster is already running - command: "docker ps -q --filter='name=ceph-mon-{{ ansible_hostname }}'" - register: ceph_health - changed_when: false - failed_when: false - check_mode: no - - name: include checks.yml include_tasks: checks.yml when: @@ -40,7 +27,7 @@ ((inventory_hostname in groups.get(mon_group_name, [])) or (inventory_hostname in groups.get(nfs_group_name, [])) or (inventory_hostname in groups.get(osd_group_name, [])))) - - ceph_health.stdout_lines | length == 0 + - not ceph_current_status.get('rc', 1) == 0 - not rolling_update | default(false) - name: include misc/ntp_atomic.yml