Commit e70c1e14 by Kevin Falcone Committed by GitHub

Merge pull request #3801 from open-craft/mtyaka/check-for-eth0

Determine default network interface name instead of hardcoding to eth0.
parents 2d984835 efe85c9d
......@@ -31,23 +31,17 @@
- deploy
- name: Set the MTU to 1500 temporarily
shell: /sbin/ifconfig eth0 mtu 1500 up
shell: "/sbin/ifconfig {{ ansible_default_ipv4.interface }} mtu 1500 up"
when: ansible_distribution in common_debian_variants
- name: Check for eth0.cfg
stat:
path: /etc/network/interfaces.d/eth0.cfg
register: eth0_cfg
- name: Set the MTU to 1500 permanently
template:
dest: /etc/network/if-up.d/mtu
src: mtu.j2
mode: 0755
owner: root
group: root
when: ansible_distribution in common_debian_variants
- name: Set the MTU to 1500 inside eth0.cfg file
lineinfile:
dest: /etc/network/interfaces.d/eth0.cfg
regexp: "^post-up /sbin/ifconfig eth0 mtu 1500"
line: "post-up /sbin/ifconfig eth0 mtu 1500"
insertafter: "^iface"
when: ansible_distribution in common_debian_variants and eth0_cfg.stat.exists
#
# End dealing with Jumbo frames issue in mixed MTU deployements in AWS
#
......
#!/bin/sh
ifconfig {{ ansible_default_ipv4.interface }} mtu 1500
......@@ -56,7 +56,7 @@ request subnet-mask, broadcast-address, time-offset, routers,
# expire 2 2000/1/12 00:00:01;
#}
interface "eth0" {
interface "{{ ansible_default_ipv4.interface }}" {
prepend domain-search {% for search in COMMON_DHCLIENT_DNS_SEARCH -%}"{{ search }}"{%- if not loop.last -%},{%- endif -%}
{%- endfor -%};
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment