Check offloading and only run command when needed.
This commit is contained in:
parent
7edebbb9aa
commit
e1fed90fee
1 changed files with 9 additions and 0 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue