diff --git a/infrastructure-playbooks/cephadm-adopt.yml b/infrastructure-playbooks/cephadm-adopt.yml index 4945493162..e23f79df53 100644 --- a/infrastructure-playbooks/cephadm-adopt.yml +++ b/infrastructure-playbooks/cephadm-adopt.yml @@ -216,11 +216,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: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} 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