From cb5a675e493e64ec27fb0bee13da54d754ff4336 Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Tue, 27 Jul 2021 22:14:38 +0430 Subject: [PATCH] cephadm-adopt: use cephadm_ssh_user for ssh user Use cephadm_ssh_user to set custom user (not root) for cephadm to ssh to the hosts Signed-off-by: Seena Fallah (cherry picked from commit 67389d08d4657a918af3b01ecd727b536ebfd28d) --- infrastructure-playbooks/cephadm-adopt.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index deca8f272..e1478c25d 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -236,11 +236,17 @@ register: cephadm_pubpkey delegate_to: '{{ groups[mon_group_name][0] }}' - - name: allow cephadm key for root account + - name: allow cephadm key for {{ cephadm_ssh_user | default('root') }} account authorized_key: - user: root + user: "{{ cephadm_ssh_user | default('root') }}" key: '{{ cephadm_pubpkey.stdout }}' + - name: set cephadm ssh user to {{ cephadm_ssh_user | default('root') }} + command: "{{ ceph_cmd }} cephadm set-user {{ cephadm_ssh_user | default('root') }}" + changed_when: false + run_once: true + delegate_to: "{{ groups[mon_group_name][0] }}" + - name: run cephadm prepare-host command: cephadm prepare-host changed_when: false