Skip to content

Commit

Permalink
Support static DNS config on bonded interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jdub committed Jan 28, 2021
1 parent f7f9da5 commit c6f2789
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/bond_Debian.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ netmask {{ item.netmask }}
{% if item.gateway is defined %}
gateway {{ item.gateway }}
{% endif %}
{% if item.dnsnameservers is defined %}
dns-nameservers {{ item.dnsnameservers }}
{% endif %}
{% endif %}
{% if item.mtu is defined %}
mtu {{ item.mtu }}
Expand All @@ -25,6 +28,9 @@ hwaddress {{ item.hwaddr }}
{% if item.pre_up is defined %}
pre-up {{ item.pre_up }}
{% endif %}
{% if item.dnssearch is defined %}
dns-search {{ item.dnssearch }}
{% endif %}
{% if item.bond_mode is defined %}
bond-mode {{ item.bond_mode }}
{% endif %}
Expand Down
8 changes: 8 additions & 0 deletions templates/bond_RedHat.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ NETMASK={{ item.netmask }}
GATEWAY={{ item.gateway }}
{% endif %}
{% endif %}
{% if item.dnsnameservers is defined %}
{% for dns_server in item.dnsnameservers.split(' ')[:2] %}
DNS{{ loop.index }}={{ dns_server }}
{% endfor %}
{% endif %}
{% if item.dnssearch is defined %}
DOMAIN={{ item.dnssearch }}
{% endif %}
{% if item.bootproto == 'dhcp' %}
BOOTPROTO=dhcp
{% endif %}
Expand Down

0 comments on commit c6f2789

Please sign in to comment.