On 09.02.17 18:07 Gabriel Birke wrote:

> - name: Import public key
>   shell: gpg --import /home/{{ backup_user}}/some_public_key.asc
>   chdir: /home/{{ backup_user}}/
>   become: yes
>   become_user: "{{ backup_user }}"

Instead of becoming this user, can you already log in as this user at
this point in time? Then setting the ansible_user variable to the
username and setting become to no would get ansible to log in as this
user directly.

But maybe you have not setup any kind of ssh authentication at this
point, so this might not be possible...

Johannes

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b1b3b1ba-041b-4ea6-a358-74df3419c80d%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to