]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
container-common: remove old check
authorSébastien Han <seb@redhat.com>
Mon, 26 Nov 2018 09:56:14 +0000 (10:56 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 3 Dec 2018 13:39:43 +0000 (14:39 +0100)
This removes a bit of unnecessary code, the check was always wrong
because of the condition 'not ceph_current_status.get('rc', 1) == 0'
It will never match since `Not` is used for bool and we are checking for
an rc.
Also, even though the check would work, this will be a major blocker for
a complete meltdown. If the whole platform is shutdown then nothing will
be up but files will be present, so this check is definitely wrong.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-container-common/tasks/checks.yml [deleted file]
roles/ceph-container-common/tasks/main.yml
roles/ceph-container-common/tasks/stat_ceph_files.yml [deleted file]

diff --git a/roles/ceph-container-common/tasks/checks.yml b/roles/ceph-container-common/tasks/checks.yml
deleted file mode 100644 (file)
index b0b978e..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- name: include stat_ceph_files.yml
-  include_tasks: stat_ceph_files.yml
-
-- name: fail if we find existing cluster files
-  fail:
-    msg: "looks like no cluster is running but ceph files are present, please remove them"
-  with_together:
-    - "{{ ceph_config_keys }}"
-    - "{{ statconfig.results }}"
-  when:
-    - inventory_hostname == groups.get(mon_group_name)
-    - item.1.stat.exists
-    - not ceph_current_status.get('rc', 1) == 0
index e2e688294b7a7e0457fb1e1cbd9f59d01f29720d..01ebd2ccf77bc65181c1ac82438c5827bdbcf3ee 100644 (file)
   when:
     - container_binary == 'docker'
 
-- name: include checks.yml
-  include_tasks: checks.yml
-  when:
-    - (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, []))
-    - not ceph_current_status.get('rc', 1) == 0
-    - not rolling_update | default(false)
-
 - name: include fetch_image.yml
   include_tasks: fetch_image.yml
   tags:
diff --git a/roles/ceph-container-common/tasks/stat_ceph_files.yml b/roles/ceph-container-common/tasks/stat_ceph_files.yml
deleted file mode 100644 (file)
index aa732cc..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
----
-- name: set_fact ceph_config_keys
-  set_fact:
-    ceph_config_keys:
-      - "{{ ceph_conf_key_directory }}/{{ cluster }}.client.admin.keyring"
-      - "{{ ceph_conf_key_directory }}/monmap-{{ cluster }}"
-      - "{{ ceph_conf_key_directory }}/{{ cluster }}.mon.keyring"
-      - /var/lib/ceph/bootstrap-osd/{{ cluster }}.keyring
-      - /var/lib/ceph/bootstrap-rgw/{{ cluster }}.keyring
-      - /var/lib/ceph/bootstrap-mds/{{ cluster }}.keyring
-      - /var/lib/ceph/bootstrap-rbd/{{ cluster }}.keyring
-
-- name: set_fact tmp_ceph_mgr_keys add mgr keys to config and keys paths
-  set_fact:
-    tmp_ceph_mgr_keys: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
-  with_items: "{{ groups.get(mgr_group_name, []) }}"
-  register: tmp_ceph_mgr_keys_result
-  when: groups.get(mgr_group_name, []) | length > 0
-
-- name: set_fact ceph_mgr_keys convert mgr keys to an array
-  set_fact:
-    ceph_mgr_keys: "{{ tmp_ceph_mgr_keys_result.results | map(attribute='ansible_facts.tmp_ceph_mgr_keys') | list }}"
-  when: groups.get(mgr_group_name, []) | length > 0
-
-- name: set_fact ceph_config_keys merge mgr keys to config and keys paths
-  set_fact:
-    ceph_config_keys: "{{ ceph_config_keys + ceph_mgr_keys }}"
-  when: groups.get(mgr_group_name, []) | length > 0
-
-- name: stat for ceph config and keys
-  stat:
-    path: "{{ fetch_directory }}/{{ fsid }}/{{ item }}"
-  delegate_to: localhost
-  with_items: "{{ ceph_config_keys }}"
-  changed_when: false
-  become: false
-  failed_when: false
-  register: statconfig
-  check_mode: no
\ No newline at end of file