Hello friends,
Am having a challenge finding a solution to below issue.
I need to generate multiple network files based on single template and the
value of template should change based on the item like IP/NM/GW .
Example
vars:
docker1ip: 1.2.3.4
docker1nm: 255.255.255.1
docker1gw: 1.2.3.1
docker2ip: 1.2.3.5
docker2nm: 255.255.255.2
docker2gw: 1.2.3.1
- name: Generating docker network Files
template: src=templates/docker_interface
dest=/etc/sysconfig/network-scripts/ifcfg-docker{{ item }}
vars:
ipaddress: {{ docker{{ item }}ip }}
netmask: {{ docker{{ item }}nm }}
gateway: {{ docker{{ item }}gw }}
with_sequence: start=1 end=2 stride=1
template
DEVICE=docker{{ item }}
BONDING_OPTS="miimon=100 mode=1"
ONPARENT=yes
BOOTPROTO=static
IPADDR={{ ipaddress }}
NETMASK={{ netmask }}
GATEWAY={{ gateway }}
Above task doesnt work but I need a solution it may be a different approach
too.
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/ae489dc7-d4ee-4f02-b167-ce7e7dbd5d12%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.