From f32755f7d4aed47b7728ba81745cedfae56410d0 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 20 Jul 2022 15:52:27 +0200 Subject: [PATCH] fix: extract public ssh key --- tasks/create_unix_user.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasks/create_unix_user.yml b/tasks/create_unix_user.yml index eccbb55..5a84bb7 100644 --- a/tasks/create_unix_user.yml +++ b/tasks/create_unix_user.yml @@ -91,8 +91,10 @@ when: unix_user.value.ssh.private_keys is defined and unix_user.value.ssh.private_keys | length >= 0 - name: Extract public SSH keys from private keys for user {{ unix_user.key }} - command: "ssh-keygen -y -f {{ user_user_home }}/.ssh/{{ item }} > {{ user_user_home }}/.ssh/{{ item }}.pub" + shell: args: + executable: /bin/bash + cmd: "ssh-keygen -y -f {{ user_user_home }}/.ssh/{{ item }} > {{ user_user_home }}/.ssh/{{ item }}.pub" creates: "{{ user_user_home }}/.ssh/{{ item }}.pub" with_items: - "{{ unix_user.value.ssh.private_keys }}"