Move the logic to the command
This commit is contained in:
parent
0a921a8bc7
commit
83e8f454ca
1 changed files with 2 additions and 2 deletions
|
@ -58,14 +58,14 @@
|
||||||
- packages
|
- packages
|
||||||
|
|
||||||
- name: check offloading
|
- name: check offloading
|
||||||
command: ethtool -k eth0
|
command: ethtool -k eth0 | egrep -q 'tcp-segmentation-offload: on|generic-receive-offload: on|generic-segmentation-offload: on'
|
||||||
register: offloading
|
register: offloading
|
||||||
changed_when: "1 != 1"
|
changed_when: "1 != 1"
|
||||||
always_run: True
|
always_run: True
|
||||||
|
|
||||||
- name: disable offloading
|
- name: disable offloading
|
||||||
command: ethtool -K eth0 tso off gro off gso off
|
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')
|
when: offloating.rc == 0
|
||||||
|
|
||||||
- name: disable offloading (persitently)
|
- 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"'
|
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-eth0 backup=yes state=present line='ETHTOOL_OPTS="-K ${DEVICE} tso off gro off gso off"'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue