Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql port parameter is ignored. #620

Closed
jairelee opened this issue Aug 2, 2019 · 0 comments · Fixed by #758
Closed

Postgresql port parameter is ignored. #620

jairelee opened this issue Aug 2, 2019 · 0 comments · Fixed by #758

Comments

@jairelee
Copy link

jairelee commented Aug 2, 2019

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 5.5.10
  • Ruby: 2.5.1p57
  • Distribution: Ubuntu 18.04.2
  • Module version: 6.7.0

How to reproduce (e.g Puppet code you use)

database_port => '5444'

What are you seeing

Parameter is ignored as default port 5432 is hard coded:
manifests/database/postgresql.pp: command => "echo ${database_host}:5432:${database_name}:${database_user}:${database_password} >> /root/.pgpass",

What behaviour did you expect instead

Parameter "database_port => '5444' " to be used when building "/root/.pgpass" and to be used when executing "Exec[zabbix_server_create.sql]"
manifests/database/postgresql.pp: command => "echo ${database_host}:${database_port}:${database_name}:${database_user}:${database_password} >> /root/.pgpass", manifests/database/postgresql.pp: unless => "grep \"${database_host}:${database_port}:${database_name}:${database_user}:${database_password}\" /root/.pgpass",

Output log

Error: 'cd /usr/share/doc/zabbix-*-pgsql && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h 'zabbix.db.domain.com' -U 'zabbix' -d 'zabbix' -f create.sql && touch /etc/zabbix/.schema.done' returned 2 instead of one of [0] Error: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_create.sql]/returns: change from 'notrun' to ['0'] failed: 'cd /usr/share/doc/zabbix-*-pgsql && if [ -f create.sql.gz ]; then gunzip -f create. sql.gz ; fi && psql -h 'zabbix.db.domain.com' -U 'zabbix' -d 'zabbix' -f create.sql && touch /etc/zabbix/.schema.done' returned 2 instead of one of [0] (corrective)

Any additional information you'd like to impart

Command "Exec[zabbix_server_create.sql]" should be updated as well -p "${database_port}":
cd /usr/share/doc/zabbix-*-pgsql && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h 'zabbix.db.domain.com' -U 'zabbix' -d 'zabbix' -p "${database_port}" -f create.sql && touch /etc/zabbix/.schema.done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant