diff --git a/saltstack/base/salt/prerequisites/path.sls b/saltstack/base/salt/prerequisites/path.sls index 86e3a229e..a55962cf6 100644 --- a/saltstack/base/salt/prerequisites/path.sls +++ b/saltstack/base/salt/prerequisites/path.sls @@ -1,15 +1,17 @@ -{% if '/usr/sbin' not in salt['environ.get']('PATH') %} -set_path_sbin: - environ.setenv: - - name: PATH - - value: "{{ salt['environ.get']('PATH') }}:/usr/sbin" - - update_minion: True +{% set path = salt['environ.get']('PATH') %} + +{% if '/usr/sbin' not in path %} + {% set path = path ~ ':/usr/sbin' %} {% endif %} -{% if '/usr/local/sbin' not in salt['environ.get']('PATH') %} -set_path_local_sbin: - environ.setenv: - - name: PATH - - value: "{{ salt['environ.get']('PATH') }}:/usr/local/sbin" - - update_minion: True +{% if '/usr/local/sbin' not in path %} + {% set path = path ~ ':/usr/local/sbin' %} {% endif %} + +/root/.bashrc: + file.append: + - text: "export PATH={{ path }}" + +refresh_profile: + cmd.run: + - name: source /root/.bashrc diff --git a/scripts/salt-install.sh b/scripts/salt-install.sh index af37fb6cb..ad5c1ef0e 100755 --- a/scripts/salt-install.sh +++ b/scripts/salt-install.sh @@ -78,10 +78,10 @@ function install_with_yum() { yum install -y zeromq zeromq-devel fi install_python_pip - if [ ! -z $(grep "^exclude=" /etc/yum.conf) ]; then - sed -i 's/^exclude=.*$/& salt/g' /etc/yum.conf - else + if [ -z "$(grep "^exclude=" /etc/yum.conf)" ]; then echo "exclude=salt" >> /etc/yum.conf + else + sed -i 's/^exclude=.*$/& salt/g' /etc/yum.conf fi install_salt_with_pip create_temp_minion_config