generated from ansible-collections/collection_template
-
Notifications
You must be signed in to change notification settings - Fork 112
Closed
Description
SUMMARY
The PGPORT environment variable is ignored.
Because of that, we have to explicitly set the port variable in all the ansible module invocation, which is quite unfortunate.
ISSUE TYPE
- Bug Report
COMPONENT NAME
postgresql_db
ANSIBLE VERSION
ansible [core 2.13.1]
config file = /playbooks/ansible.cfg
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.9/dist-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /usr/local/bin/ansible
python version = 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
jinja version = 3.1.2
libyaml = True
COLLECTION VERSION
Collection Version
-------------------- -------
community.postgresql 2.1.5
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
- Start postgres in a non default port (e.g. 1234)
- Export the
PGPORT=1234environment variable - run the following playbook
- hosts: localhost
connection: local
tasks:
- name: Create database
postgresql_db:
name: example
#port: 1234 # this works.
#port: "{{ lookup('ansible.builtin.env', 'PGPORT') }}" # this also works.EXPECTED RESULTS
Expected that exporting the PGPORT environment variable would set the used port.
ACTUAL RESULTS
TASK [Create database] *********************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: TCP/IP connections on port 5432?
fatal: [localhost]: FAILED! => {"changed": false, "msg": "unable to connect to database: could not connect to server: Connection refused\n\tIs the server running on host \"yb-tservers.yugabytedb\" (10.244.0.18) and accepting\n\tTCP/IP connections on port 5432?\n"}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels