Check offloading and only run command when needed.

This commit is contained in:
Kevin Fenzi 2016-06-25 20:35:47 +00:00
parent 7edebbb9aa
commit e1fed90fee

View file

@ -56,8 +56,17 @@
dnf: state=present pkg=ethtool
tags:
- packages
- name: check offloading
command: ethtool -k eth0
register: offloading
changed_when: "1 != 1"
always_run: True
- name: disable offloading
command: ethtool -K eth0 tso off gro off gso off
when: offloating.stdout.find('tcp-segmentation-offload: on') == -1 and offloating.stdout.find('generic-receive-offload: on') == -1 and offloating.stdout.find('generic-segmentation-offload: on')
- name: disable offloading (persitently)
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-eth0 backup=yes state=present line='ETHTOOL_OPTS="-K ${DEVICE} tso off gro off gso off"'
tags: