Skip to content

Commit

Permalink
cephadm-adopt: use cephadm_ssh_user for ssh user
Browse files Browse the repository at this point in the history
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>
(cherry picked from commit 67389d0)
  • Loading branch information
clwluvw authored and guits committed Sep 14, 2021
1 parent c8cadaa commit eef429a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions infrastructure-playbooks/cephadm-adopt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eef429a

Please sign in to comment.