sudo ansible-playbook ..... will work but then you're running the whole play as local root, which feels wrong.
I can't think why you'd want to do that, if you aren't making changes to that host. In this example you're shipping public keys, there's no downside to having them locally (or better still version controlled, so you remove a particular workstation as a single point of failure). On 14 July 2017 at 16:56, Anfield <gareth.has...@gmail.com> 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? > >> > -- > 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/d78ee2c5-e7ed-44cc-b7a6-b128b2cb583b%40googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- 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/CAK5eLPTc%3DPvokzN2_MuGVBazjAE9kUDhT3_V%3Dd-TmxxaPkU9Kw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.