run ansible module with vars
lguohan opened this issue · comments
Guohan Lu commented
how can i implement such playbook task
- name: Generate configurations for exabgp instances
template: src=roles/test/templates/exabgp/config.j2 dest={{exabgp_dir}}/{{item.file_name}}
with_items:
- {file_name: "config_1.ini", local_ip: '{{speaker_ips[0]}}', port_num: '5000'}
- {file_name: "config_2.ini", local_ip: '{{speaker_ips[1]}}', port_num: '6000'}
- {file_name: "config_3.ini", local_ip: '{{vlan_ips[0]}}', port_num: '7000'}
when I call template module, how can i supply additional vars such as local_ip, port_num. Is there an example?
Guohan Lu commented
can override extra_vars.