Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CDPR-43 CDPR-44 #632

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions saltstack/base/salt/prerequisites/path.sls
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions scripts/salt-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down