From c2bad9fa418ed16ad8e917af40ec584c6c6a35ec Mon Sep 17 00:00:00 2001 From: ricolin Date: Tue, 5 Dec 2023 14:46:52 +0800 Subject: [PATCH] fix: lint and make sure ssh key generated --- roles/mon/tasks/adopt.yml | 10 +++++++--- roles/mon/tasks/bootstrap-ceph.yml | 6 ++++++ roles/osd/tasks/adopt.yml | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/roles/mon/tasks/adopt.yml b/roles/mon/tasks/adopt.yml index a85f1893..5007c556 100644 --- a/roles/mon/tasks/adopt.yml +++ b/roles/mon/tasks/adopt.yml @@ -12,13 +12,17 @@ # License for the specific language governing permissions and limitations # under the License. -# TODO: assimilate config from a mon (we can use run_once here, configs should all be same) +# TODO: assimilate config from a mon +# (we can use run_once here, configs should all be same) # TODO: adopt mon (with throttle: 1) so we do it one at a time -# TODO: adopt mgr (with throttle: 1) so we do it one at a time (note this is kinda cheating, because we are adopting it in mon role, but we always ran them on same node) +# TODO: adopt mgr (with throttle: 1) so we do it one at a time +# (note this is kinda cheating, because we are adopting it +# in mon role, but we always ran them on same node) # TODO: enable cephadm mgr module + set orch to cephadm # TODO: ceph cephadm set-user # TODO: generate key -# TODO: essetnially the end-state here should be that the rest of the main.yml runs fine +# TODO: essetnially the end-state here should be that +# the rest of the main.yml runs fine - name: Validate monitor adoption ansible.builtin.command: ceph orch ps diff --git a/roles/mon/tasks/bootstrap-ceph.yml b/roles/mon/tasks/bootstrap-ceph.yml index 9a4955b0..c7de345c 100644 --- a/roles/mon/tasks/bootstrap-ceph.yml +++ b/roles/mon/tasks/bootstrap-ceph.yml @@ -45,6 +45,12 @@ --config {{ ceph_mon_conf_tempfile.path }} --skip-monitoring-stack changed_when: false + + - name: Generate ssh key + changed_when: false + ansible.builtin.command: + cmd: cephadm shell -- ceph cephadm generate-key + always: - name: Remove temporary file for "ceph.conf" ansible.builtin.file: diff --git a/roles/osd/tasks/adopt.yml b/roles/osd/tasks/adopt.yml index be621fd5..eb986928 100644 --- a/roles/osd/tasks/adopt.yml +++ b/roles/osd/tasks/adopt.yml @@ -17,8 +17,10 @@ - name: Get osd list from cluster ansible.builtin.command: ceph osd ls register: osd_list + changed_when: false - name: Adopt existing osds ansible.builtin.command: cmd: cephadm adopt --style legacy --name "osd.{{ item }}" with_items: "{{ osd_list.stdout_lines }}" + changed_when: false