diff --git a/defaults/main.yml b/defaults/main.yml index 9bea4f6..d93ca2c 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,3 +37,4 @@ ipv6_autoconf: no # Slaves options keep_slave_ipv4: false +keep_slave_hwaddr: true diff --git a/templates/rh_ifcfg-slaves.j2 b/templates/rh_ifcfg-slaves.j2 index 002c086..2cdb63c 100644 --- a/templates/rh_ifcfg-slaves.j2 +++ b/templates/rh_ifcfg-slaves.j2 @@ -6,7 +6,9 @@ ONBOOT=yes SLAVE=yes MASTER="{{ bond }}" MTU="{{ mtu }}" +{% if keep_slave_hwaddr %} HWADDR="{{ hostvars[inventory_hostname][iface].macaddress }}" +{% endif %} {% if keep_slave_ipv4 %} {% if hostvars[inventory_hostname][iface].ipv4 %} IPADDR="{{ hostvars[inventory_hostname][iface].ipv4.address }}"