reading playbook vars from custom module?

14 views
Skip to first unread message

l vic

unread,
Sep 12, 2019, 10:06:32 AM9/12/19
to Ansible Development
Hello,
Is there a way to read playbook vars such as:
- hosts: webservers
 
vars:
   
http_port: 80

from custom module (python)?

Matt Martz

unread,
Sep 12, 2019, 10:08:34 AM9/12/19
to l vic, Ansible Development
Modules are run without knowledge of playbook state.  For a module to have access playbook state, it must be explicitly passed by the user as module arguments to the module.

--
You received this message because you are subscribed to the Google Groups "Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-deve...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-devel/8da9851c-7a29-46f1-bc11-cba912570bae%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages