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
|
||||
|
||||
iface eth0 inet static
|
||||
address {{ hostvars[inventory_hostname].ansible_default_ipv4.address }}
|
||||
netmask {{ hostvars[inventory_hostname].ansible_default_ipv4.netmask }}
|
||||
gateway {{ hostvars[inventory_hostname].ansible_default_ipv4.gateway }}
|
||||
address {{ ansible_host }}/{{ netmask }}
|
||||
gateway {{ gateway }}
|
||||
|
||||
{% if ip6 is defined %}
|
||||
iface eth0 inet6 static
|
||||
address {{ ip6 }}
|
||||
netmask {{ netmask6 }}
|
||||
address {{ ip6 }}/{{ netmask6 }}
|
||||
gateway {{ gateway6 }}
|
||||
pre-up echo 0 > /proc/sys/net/ipv6/conf/eth0/accept_ra
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue