How to pass variables into modules in Ansible

49 views
Skip to first unread message

ZaVaZaVa

unread,
May 29, 2016, 11:42:50 AM5/29/16
to Ansible Project

Hello


I am new into ansible and I would appreciate some help here...

I am working on a new Project to automatic our Infrastructure Network Deployment and Configuration.

Question: How do I pass parameters to a YML file or, assuming it is the same, how do I pass variables into modules defined within Playbook.


All help is  highly appreciated.


Regards


ZaVaZaVa

Johannes Kastl

unread,
May 29, 2016, 3:33:02 PM5/29/16
to ansible...@googlegroups.com
On 29.05.16 03:19 ZaVaZaVa wrote:

> Question: How do I pass parameters to a YML file or, assuming it is the
> same, how do I pass variables into modules defined within Playbook.

I fear your question is too wide to get really good answers. Why don't
you give an example of what you are trying to achieve? Or which code
works/does not work for you?

Generally, variables set in host_vars, group_vars, vars-sections of
plays and similar are set and can be used within a play or role or task.

https://docs.ansible.com/ansible/playbooks_variables.html

Johannes


signature.asc

ZaVaZaVa

unread,
May 29, 2016, 10:49:48 PM5/29/16
to Ansible Project
Thanks Johannes.

What I really wanted to understand it is just the generic method or methods of defining and passing variables to a module in a  playbook. I am at the beginning of learning ansible and that is one of the questions I would like to have clarified.

Zava
Reply all
Reply to author
Forward
0 new messages