How to pass variables into modules in Ansible

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

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

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