Browse Source

[network][vlan] use ansible fact to populate the template for network

interfaces

as the network interface transition to new names we can still get some
information from the system and use it in our template. This will not
change the name of the interface but it will configure it to our needs.
python3
Edoardo Putti 8 years ago
parent
commit
6b86ac4ff5
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      templates/interfaces.j2

+ 4
- 4
templates/interfaces.j2 View File

@ -10,12 +10,12 @@ iface lo inet loopback
# The primary network interface
auto br0
iface br0 inet manual
bridge_ports eth0.{{ virtual_machine_vlan }}
bridge_ports {{ ansible_default_ipv4.alias }}.{{ virtual_machine_vlan }}
bridge_fd 1
auto eth0.{{ management_vlan }}
iface eth0.{{ management_vlan }} inet static
auto {{ ansible_default_ipv4.alias }}
iface {{ ansible_default_ipv4.alias }} inet static
address {{ ansible_default_ipv4.address }}
gateway {{ hostvars[ext_gateway]['ansible_host'] }}
netmask 255.255.255.0
vlan-raw-device eth0
vlan-raw-device {{ ansible_default_ipv4.alias }}

Loading…
Cancel
Save