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 <seenafallah@gmail.com>
pull/6846/head
Seena Fallah 2021-07-27 22:14:38 +04:30 committed by Guillaume Abrioux
parent 1db8fa8989
commit 67389d08d4
1 changed files with 8 additions and 2 deletions

View File

@ -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