Re: [ansible-project] pass playbook vars to a python script

2020-07-29 Thread Stefan Hornburg (Racke)
On 7/28/20 10:40 PM, Jerry Hwang wrote:
> 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

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-project+unsubscr...@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
> .


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

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/6a8290de-afdb-d39f-84a1-b0afa928d7c2%40linuxia.de.


signature.asc
Description: OpenPGP digital signature


[ansible-project] pass playbook vars to a python script

2020-07-28 Thread Jerry Hwang
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

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c6c78c90-e0eb-4ad9-b6a5-2317586f16ddo%40googlegroups.com.