Affects Version/s: None
Fix Version/s: None
QA Risk Assessment:Needs Assessment
Module Version: 7.3.0
Puppet Version: 6.24.0
OS Name/Version: CentOS 7, CentOS 8
Describe your issue in as much detail as possible...
Setting the PGDATA environment variable (in /etc/systemd/system/postgresql.service.d/postgresql.conf) and data_directory in postgresql.conf is redundant, with the later taking priority over the former.
If we'd only set the PGDATA environment variable, and not data_directory, one could copy the whole data directory to a different system (with a different path) and "just" use it, without fiddling with the config.
Right now, I just call `sed -i /data_directory/d postgresql.conf` when moving, which seems odd and will be "restored" on the next Puppet run.
Puppet sets PGDATA and data_directory, making copying the data directory outside of Puppet harder than necessary.