On Tue, 10 Dec 2019 at 12:31, Rakesh Parida <[email protected]> wrote: > > Hi > > I have a Ansible playbook as below: > test.env.yml > --- > - hosts: localhost > > tasks: > - debug: msg="{{ lookup('env','SUDO_USER') }} is an environment variable" > > Now i have setup a python virtual env and want to invoke the playbook using > python:
STOP Running playbooks is done using 'ansible-playbook' - not with hand crafted python scripts. See https://docs.ansible.com/ansible/latest/cli/ansible-playbook.html Also, it looks like you have an issue understanding privilege escalation. Please look at the docs about that as well: https://docs.ansible.com/ansible/latest/user_guide/become.html Lastly - you haven't told what you are actually trying to achieve with ansible? What are you trying to automate? -- Dick Visser Trust & Identity Service Operations Manager GÉANT -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwPMy2gTn907%2BOvozOnmCWRi6XmKYPq7YVUb-MDYHOF6vQ%40mail.gmail.com.
