Skip to content

Commit

Permalink
add_livemigration_user: remove ssh directory creation
Browse files Browse the repository at this point in the history
This task is not needed since the Ansible module authorized_key is doing
it automatically.

In addition, the path variable is not required by authorized_key, this
ansible module will automatically get the right path using the parameter
"user".

These modifications ensure both distributions are supported and avoid to
define distribution specific behavior

Signed-off-by: Tanguy Raufflet <[email protected]>
  • Loading branch information
Tanguy Raufflet authored and TanguyRaufflet committed Dec 5, 2024
1 parent 1db8bf5 commit e9828a1
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions roles/add_livemigration_user/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
ssh_key_file: .ssh/id_rsa
ssh_key_passphrase: ""
force: false
- name: create livemigration .ssh directory
file:
path: "/home/{{ livemigration_user }}/.ssh"
state: directory
mode: '0700'
owner: "{{ livemigration_user }}"
- name: Get root user's home directory
shell: getent passwd root | cut -d ':' -f6
register: root_home_dir
Expand All @@ -43,7 +37,6 @@
authorized_key:
user: "{{ livemigration_user }}"
state: present
path: "/home/{{ livemigration_user }}/.ssh/authorized_keys"
key: "{{ lookup('file','buffer/' + item + '-id_rsa.pub') }}"
with_items: "{{ groups['hypervisors'] }}"
- name: Fetch the ssh keyfile
Expand Down

0 comments on commit e9828a1

Please sign in to comment.