network configuration from host_vars
This commit is contained in:
parent
cfa432c4ce
commit
182ece622e
1 changed files with 3 additions and 5 deletions
|
@ -5,14 +5,12 @@ iface lo inet loopback
|
||||||
auto eth0
|
auto eth0
|
||||||
|
|
||||||
iface eth0 inet static
|
iface eth0 inet static
|
||||||
address {{ hostvars[inventory_hostname].ansible_default_ipv4.address }}
|
address {{ ansible_host }}/{{ netmask }}
|
||||||
netmask {{ hostvars[inventory_hostname].ansible_default_ipv4.netmask }}
|
gateway {{ gateway }}
|
||||||
gateway {{ hostvars[inventory_hostname].ansible_default_ipv4.gateway }}
|
|
||||||
|
|
||||||
{% if ip6 is defined %}
|
{% if ip6 is defined %}
|
||||||
iface eth0 inet6 static
|
iface eth0 inet6 static
|
||||||
address {{ ip6 }}
|
address {{ ip6 }}/{{ netmask6 }}
|
||||||
netmask {{ netmask6 }}
|
|
||||||
gateway {{ gateway6 }}
|
gateway {{ gateway6 }}
|
||||||
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
|
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue