openqa/worker: make some file existence checks safer

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2018-03-06 15:24:37 -08:00
parent df75f880d1
commit f7c87b0f75

View file

@ -29,11 +29,11 @@
- name: Make sure usb0 doesn't get in our way
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-usb0 regexp="^ONBOOT=" line="ONBOOT=no"
when: (ifcfgusb0.stat.exists == True) and (deployment_type is defined)
when: (ifcfgusb0.stat.exists is defined) and (ifcfgusb0.stat.exists == True) and (deployment_type is defined)
- name: Make sure eth1 doesn't get in our way
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-eth1 regexp="^ONBOOT=" line="ONBOOT=no"
when: (ifcfgeth1.stat.exists == True) and (deployment_type is defined)
when: (ifcfgeth1.stat.exists is defined) and (ifcfgeth1.stat.exists == True) and (deployment_type is defined)
- name: Start openvswitch service
service: name=openvswitch enabled=yes state=started