add a profile.d script to add bin_dir to path
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
postgres:
|
||||
use_upstream_repo: True
|
||||
add_path: False # add bin_dir to $PATH, if installed from repos
|
||||
version: '10'
|
||||
pkg: postgresql
|
||||
pkgs_extra: []
|
||||
|
||||
3
postgres/templates/postgres.sh.j2
Normal file
3
postgres/templates/postgres.sh.j2
Normal file
@@ -0,0 +1,3 @@
|
||||
if ! echo $PATH | grep -q {{ bin_dir }} ; then
|
||||
export PATH=$PATH:{{ bin_dir }}
|
||||
fi
|
||||
@@ -5,6 +5,18 @@
|
||||
|
||||
{%- if postgres.use_upstream_repo == true -%}
|
||||
|
||||
{%- if postgres.add_path -%}
|
||||
postgresql-profile:
|
||||
file.managed:
|
||||
- name: /etc/profile.d/postgres.sh
|
||||
- user: root
|
||||
- group: root
|
||||
- mode: 644
|
||||
- template: jinja
|
||||
- source: salt://postgres/templates/postgres.sh.j2
|
||||
- defaults:
|
||||
bin_dir: {{ postgres.bin_dir }}
|
||||
{%- endif %}
|
||||
# Add upstream repository for your distro
|
||||
postgresql-repo:
|
||||
pkgrepo.managed:
|
||||
|
||||
Reference in New Issue
Block a user