On 14. juli 2017 17:56, Anfield wrote:
Thanks. So its clear why this didnt work. Can I ask you how I can tell the
playbook to switch to root to execute the commands on the localhost with
escalated privileges?

What is do is adding all the public keys to the ansible configuration and copies it out from there.


But i guess you could have to plays in one playbook.

One that runs against localhost with become and use slurp module to get the content in memory/variable.

And in play number two copy the content of the variable in the first play out to the authorized_keys.


Or as Dick say, run ansible-playbook as root.


--
Kai Stian Olstad

--
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/ca923f94-00a0-5657-ac24-659108a47d2e%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to