Add postgresql option target_session_attrs #1847
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Added support for the postgresql option 'target_session_attrs'. This is required if you have a postgreSQL database cluster and want to ensure that AWX only connects to the primary database node with write permissions.
This change is all the more necessary as this option cannot be passed in
custom.py
as the order in which the configuration files are loaded is not stable. It is therefor not possible to guarantee, that theDATABASES
dictionary is already defined or will be overwritten later.PR fixes #1792
ISSUE TYPE
ADDITIONAL INFORMATION
The following has been added:
target_session_attrs
to the database credentials template in the ansible installer roletarget_session_attrs
to the postgresql config template in the helm chartI've successfully tested that change with
molecule/kind
and in our own K8s Cluster with postgreSQL-Cluster database backend.