]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
common: clean monitor initial keyring code
authorGuillaume Abrioux <gabrioux@redhat.com>
Thu, 10 Jan 2019 13:08:42 +0000 (14:08 +0100)
committerSébastien Han <seb@redhat.com>
Wed, 30 Jan 2019 09:36:02 +0000 (10:36 +0100)
let's not be blocked by the fact we don't have the initial keyring in
`{{ fetch_directory }}`

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
roles/ceph-common/tasks/facts_mon_fsid.yml [deleted file]
roles/ceph-common/tasks/main.yml
roles/ceph-facts/tasks/facts.yml

diff --git a/roles/ceph-common/tasks/facts_mon_fsid.yml b/roles/ceph-common/tasks/facts_mon_fsid.yml
deleted file mode 100644 (file)
index a5023ca..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
----
-- name: check if /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring already exists
-  stat:
-    path: /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring
-  register: initial_mon_keyring
-
-- name: fail if /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring doesn't exist
-  fail:
-    msg: "/var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring not found"
-  when:
-    - not initial_mon_keyring.stat.exists
-
-- name: get existing initial mon keyring if it already exists but not monitor_keyring.conf in {{ fetch_directory }}
-  shell: |
-    grep key /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring | sed 's/^.*= //'
-  register: monitor_keyring
-  when:
-    - not monitor_keyring_conf.stat.exists
-
-- name: test existing initial mon keyring
-  command: ceph --connect-timeout 3 --cluster {{ cluster }} --keyring /var/lib/ceph/mon/{{ cluster }}-{{ monitor_name }}/keyring -n mon. fsid
-  changed_when: false
-  register: test_initial_monitor_keyring
-  ignore_errors: true
-
-- name: fail if initial mon keyring found doesn't work
-  fail:
-    msg: "Initial mon keyring found doesn't work."
-  when:
-    - test_initial_monitor_keyring.rc != 0
-
-- name: write initial mon keyring in {{ fetch_directory }}/monitor_keyring.conf if it doesn't exist
-  shell: "echo {{ monitor_keyring.stdout }} | tee {{ fetch_directory }}/monitor_keyring.conf"
-  delegate_to: localhost
-  become: false
-  when:
-    - test_initial_monitor_keyring.rc == 0
-
-- name: put initial mon keyring in mon kv store
-  command: ceph --cluster {{ cluster }} config-key put initial_mon_keyring {{ monitor_keyring.stdout }}
-  when:
-    - test_initial_monitor_keyring.rc == 0
index 6f73617c1f584a2ae861080c8f5c3f74953d695c..44c524d7ea6e5939c7c25953521a3baed778c841 100644 (file)
   tags:
     - always
 
-- name: include facts_mon_fsid.yml
-  include_tasks: facts_mon_fsid.yml
-  run_once: true
-  when:
-    - cephx
-    - mon_group_name in group_names
-    - not monitor_keyring_conf.stat.exists
-    - ceph_current_status.fsid is defined
-
 - name: include create_rbd_client_dir.yml
   include_tasks: create_rbd_client_dir.yml
 
index aad7e84059be541271ad48d02620fefc5911b31d..854f23b53ea33515c873f84984110b6ad4acda2b 100644 (file)
     - not rolling_update
     - groups.get(mon_group_name, []) | length > 0
 
-# We want this check to be run only on the first node
-- name: check if {{ fetch_directory }} directory exists
-  stat:
-    path: "{{ fetch_directory }}/monitor_keyring.conf"
-  delegate_to: localhost
-  become: false
-  register: monitor_keyring_conf
-  run_once: true
-
 # set this as a default when performing a rolling_update
 # so the rest of the tasks here will succeed
 - name: set_fact ceph_current_status rc 1