Module Version: 6.6.0
Puppet Version: 6.16.0
OS Name/Version: CentOS 8 + Oracle Linux 8
In params.pp package names, bindir and some other settings are picked incorrectly when version equals default_version and one is not using distro packages (manage_package_repo).
In this case server_package_name is set to 'postgresql-server' and this leads to not installing the correct version of postgreql if another version is already installed.
Also bindir is set incorrectly to /usr/bin and initdb fails.
Probably it should not be checked whether version equals default_version, but whether upstream postgresql packages are used (manage_package_repo).
Changing postgresql version to 10 on RedHat family (CentOS, ...) should install postgresql10-server, even if another postgresql-server package is already installed.
Executable initdb should be found.
If package postgresql11-package ist installed and the module is set to version 10, puppet does not install postgresql10-server.
Also when trying to run initdb it fails, because /usr/bin/initdb does not exist.