mirror of
https://github.com/saltstack-formulas/postgres-formula.git
synced 2025-04-16 17:50:27 +00:00
Merge pull request #246 from gilou/path_repo
allow to add bin_dir to path
This commit is contained in:
commit
ccfe9c2b7c
4 changed files with 24 additions and 0 deletions
|
@ -8,6 +8,9 @@ postgres:
|
||||||
use_upstream_repo: False
|
use_upstream_repo: False
|
||||||
# Version to install from upstream repository (if upstream_repo: True)
|
# Version to install from upstream repository (if upstream_repo: True)
|
||||||
version: '10'
|
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
|
# If automatic package installation fails, use `fromrepo` to specify the
|
||||||
# upstream repo to install packages from [#133, #185] (if upstream_repo: True)
|
# upstream repo to install packages from [#133, #185] (if upstream_repo: True)
|
||||||
fromrepo: 'jessie-pgdg'
|
fromrepo: 'jessie-pgdg'
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
use_upstream_repo: True
|
use_upstream_repo: True
|
||||||
|
add_profile: False # add bin_dir to $PATH, if installed from repos
|
||||||
version: '10'
|
version: '10'
|
||||||
pkg: postgresql
|
pkg: postgresql
|
||||||
pkgs_extra: []
|
pkgs_extra: []
|
||||||
|
|
8
postgres/templates/postgres.sh.j2
Normal file
8
postgres/templates/postgres.sh.j2
Normal 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
|
|
@ -5,6 +5,18 @@
|
||||||
|
|
||||||
{%- if postgres.use_upstream_repo == true -%}
|
{%- 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
|
# Add upstream repository for your distro
|
||||||
postgresql-repo:
|
postgresql-repo:
|
||||||
pkgrepo.managed:
|
pkgrepo.managed:
|
||||||
|
|
Loading…
Add table
Reference in a new issue