saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Get access to the Salt software package repository here:
https://repo.saltproject.io/
Apache License 2.0
14.1k stars 5.47k forks source link

Postgres.bins_dir prefers system util over specified bin directory #53190

Open doesitblend opened 5 years ago

doesitblend commented 5 years ago

Description of Issue/Question

In the event that you have two versions of Postgresql installed on a server the "system" level PG utils are still being preferred over the utils specified by postgres.bins_dir.

https://github.com/saltstack/salt/blob/d0cad3e5a35ba80f18413820227dea4f3d6234d3/salt/modules/postgres.py#L131

Setup

Install Postgresql from RHEL repo (should be 9.2). Then install 9.6 from the official Postgresql repo. Run a state like the following:

{% set pg_setup_path = '/usr/lib/postgresql/9.6/bin/postgres' %}
{% set postgresql_conf = '/usr/lib/postgresql/9.6/data/postgresql.conf' %}
{% set db_password = 'abc123' %}

zabbix_database_user: 
  postgres_user.present: 
    - name: zabbix 
    - password: {{ db_password }}

zabbix_database: 
  postgres_database.present: 
    - name: zabbix 
    - owner: zabbix 

Versions Report

This was tested on 2019.2.0, but the code is the same in this section for 2018.3.4.

    Salt Version:
               Salt: 2019.2.0

    Dependency Versions:
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: 2.5.3
          docker-py: Not Installed
              gitdb: Not Installed
          gitpython: Not Installed
              ioflo: Not Installed
             Jinja2: 2.9.4
            libgit2: Not Installed
            libnacl: Not Installed
           M2Crypto: Not Installed
               Mako: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.8
       mysql-python: Not Installed
          pycparser: Not Installed
           pycrypto: 2.6.1
       pycryptodome: Not Installed
             pygit2: Not Installed
             Python: 2.7.13 (default, Sep 26 2018, 18:42:22)
       python-gnupg: Not Installed
             PyYAML: 3.12
              PyZMQ: 16.0.2
               RAET: Not Installed
              smmap: Not Installed
            timelib: Not Installed
            Tornado: 4.4.3
                ZMQ: 4.2.1

    System Versions:
               dist: debian 9.5 
             locale: UTF-8
            machine: x86_64
            release: 4.9.125-linuxkit
             system: Linux
            version: debian 9.5 
doesitblend commented 5 years ago

ZD-3722

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

stale[bot] commented 4 years ago

Thank you for updating this issue. It is no longer marked as stale.