From 3ad9e9c5eb7c5ebd110803cd399ef01010626340 Mon Sep 17 00:00:00 2001
From: Henry Finucane <henry.finucane@illumio.com>
Date: Tue, 12 Jun 2018 11:30:18 -0700
Subject: [PATCH] Fix #2261 by supporting Red Hat's limited PATH

Red Hat has this theory that binaries in sbin are too dangerous to be on
the default path, but we need them anyway.

RH7 has /sbin and /usr/sbin as symlinks, so that is no longer important.

I'm adding it to the `PATH` instead of making the path to `modinfo`
absolute because I am worried about breaking support for other
distributions.
---
 roles/kubernetes/node/tasks/main.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/roles/kubernetes/node/tasks/main.yml b/roles/kubernetes/node/tasks/main.yml
index f7520caf8..086b94563 100644
--- a/roles/kubernetes/node/tasks/main.yml
+++ b/roles/kubernetes/node/tasks/main.yml
@@ -70,6 +70,8 @@
 
 - name: Verify if br_netfilter module exists
   shell: "modinfo br_netfilter"
+  environment:
+    PATH: "{{ ansible_env.PATH}}:/sbin"  # Make sure we can workaround RH's conservative path management
   register: modinfo_br_netfilter
   failed_when: modinfo_br_netfilter.rc not in [0, 1]
   changed_when: false
-- 
GitLab