From 64134eabccbcc86bc58e491f2f6c958ce15ed43f Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Thu, 30 Aug 2018 13:20:12 +0000 Subject: [PATCH] Fix OVS detection Although my shell returns 127 when a command is not found, Ansible's command module seems to be getting 2. Assume non-zero means not installed. --- ansible/host_setup.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ansible/host_setup.yml b/ansible/host_setup.yml index ca38567..f3a99f7 100644 --- a/ansible/host_setup.yml +++ b/ansible/host_setup.yml @@ -28,10 +28,10 @@ state: running enabled: true become: true - # Return code 127 means the command does not exist. Do this check to avoid - # installing Open vSwitch system-wide if the command already exists as a link - # to a containerised version of OVS. - when: ovs_vsctl_check.rc == 127 + # Assume a non-zero return code means the command does not exist. Do this + # check to avoid installing Open vSwitch system-wide if the command already + # exists as a link to a containerised version of OVS. + when: ovs_vsctl_check.rc != 0 - name: Configure physical networks include_tasks: physical_network.yml