pass playbook vars to a python script

13 views
Skip to first unread message

Jerry Hwang

unread,
Jul 28, 2020, 4:40:26 PM7/28/20
to Ansible Project
hello,

I am trying to have a python script (auto triggered when a playbook is run) to take from playbook extra_vars and uses it as var for the script.

for example:
ansible-playbook test.yml --extra-vars "win=True"

something like in the script
result = self.playbook.extra_vars['win']

any good tips, suggestions

Thanks,
Jerry

Stefan Hornburg (Racke)

unread,
Jul 29, 2020, 2:34:44 AM7/29/20
to ansible...@googlegroups.com
Hello Jerry,

how is this script auto triggered?

Regards
Racke

>
> --
> 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-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/c6c78c90-e0eb-4ad9-b6a5-2317586f16ddo%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c6c78c90-e0eb-4ad9-b6a5-2317586f16ddo%40googlegroups.com?utm_medium=email&utm_source=footer>.


--
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

signature.asc
Reply all
Reply to author
Forward
0 new messages