Iterate over a variable for network management
This commit is contained in:
parent
9075aab593
commit
8192f76787
@ -9,8 +9,9 @@
|
|||||||
- name: Install network interfaces
|
- name: Install network interfaces
|
||||||
template:
|
template:
|
||||||
src: "{{ network_type }}-interface.cfg"
|
src: "{{ network_type }}-interface.cfg"
|
||||||
dest: "/etc/network/interfaces.d/{{ ip_inter }}"
|
dest: "/etc/network/interfaces.d/{{ item.name }}"
|
||||||
notify: reboot_host
|
notify: reboot_host
|
||||||
|
loop: "{{ interfaces }}"
|
||||||
|
|
||||||
- name: Install bridge utilities
|
- name: Install bridge utilities
|
||||||
apt:
|
apt:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# {{ ansible_managed }}
|
# {{ ansible_managed }}
|
||||||
|
|
||||||
# The primary network interface
|
# The primary network interface
|
||||||
auto {{ ip_inter }}
|
auto {{ item.name }}
|
||||||
iface {{ ip_inter }} inet static
|
iface {{ item.name }} inet static
|
||||||
address {{ ip_addr }}
|
address {{ item.address }}
|
||||||
gateway {{ ip_gateway }}
|
gateway {{ item.gateway }}
|
||||||
|
Loading…
Reference in New Issue
Block a user