Merge pull request #246 from gilou/path_repo

allow to add bin_dir to path
This commit is contained in:
Javier Bértoli 2018-10-11 08:51:10 -03:00 committed by GitHub
commit ccfe9c2b7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 0 deletions

View file

@ -8,6 +8,9 @@ postgres:
use_upstream_repo: False
# Version to install from upstream repository (if upstream_repo: True)
version: '10'
# Set True to add a file in /etc/profile.d adding the bin dir in $PATH
# as packages from upstream put them somewhere like /usr/pgsql-10/bin
add_profile: False
# If automatic package installation fails, use `fromrepo` to specify the
# upstream repo to install packages from [#133, #185] (if upstream_repo: True)
fromrepo: 'jessie-pgdg'

View file

@ -2,6 +2,7 @@
postgres:
use_upstream_repo: True
add_profile: False # add bin_dir to $PATH, if installed from repos
version: '10'
pkg: postgresql
pkgs_extra: []

View file

@ -0,0 +1,8 @@
######################################################################
# ATTENTION! Managed by SaltStack. #
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN! #
######################################################################
if ! echo $PATH | grep -q {{ bin_dir }} ; then
export PATH=$PATH:{{ bin_dir }}
fi

View file

@ -5,6 +5,18 @@
{%- if postgres.use_upstream_repo == true -%}
{%- if postgres.add_profile -%}
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: