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

pg_hba problems in zabbix::database #411

Closed
RaphaelNeumann opened this issue Jun 20, 2017 · 0 comments
Closed

pg_hba problems in zabbix::database #411

RaphaelNeumann opened this issue Jun 20, 2017 · 0 comments

Comments

@RaphaelNeumann
Copy link
Contributor

RaphaelNeumann commented Jun 20, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.9.2
  • Ruby: 2.0.0p648 (2015-12-16) [x86_64-linux]
  • Distribution: Rhel7
  • Module version: 4.1.0

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

node 'zabbix.srv' {
  class { 'apache':
    mpm_module => 'prefork',
  }

  class { 'apache::mod::php': }
  
  class { 'zabbix::web':
    manage_repo   => false,
    zabbix_url    => 'zabbix.local',
    zabbix_server => '192.168.100.55',
    database_host => '192.168.100.50',
    database_type =>'postgres',
  }
  
  class { 'postgresql::client': }

  class { 'zabbix::server':
    manage_repo   => false,
    database_host  => '192.168.100.50',
    database_type  => 'postgres'
  }
}

node 'postgres.srv' {
  class { 'postgresql::server':
    listen_addresses => '192.168.10.50'
  }

  class { 'zabbix::database':
	  database_type    => 'postgres'
	  zabbix_web_ip    => '192.168.100.55,
	  zabbix_server_ip => '192.168.100.55'
  }
}

What are you seeing

When the zabbix_server and zabbix_web are at the same server but the database are on another this module don't create a pg_hba rule for zabbix_server/zabbix_web

What behaviour did you expect instead

I expect the zabbix_database class was create a zabbix database and create a pg_hba rule for zabbix_server

Output log

Info: Using configured environment 'zabbix'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for renegade.detran.df
Info: Applying configuration version '1497997556'
Notice: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_create.sql]/returns: psql: FATAL: no pg_hba.conf entry for host "10.138.100.143", user "zabbix_server", database "zabbix_server", SSL off
Error: cd /usr/share/doc/zabbix--pgsql-3.2/ && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h '10.138.100.23' -U 'zabbix_server' -d 'zabbix_server' -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-3.2/ && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h '10.138.100.23' -U 'zabbix_server' -d 'zabbix_server' -f create.sql && touch /etc/zabbix/.schema.done returned 2 instead of one of [0]
Notice: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_images.sql]: Dependency Exec[zabbix_server_create.sql] has failures: true
Warning: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_images.sql]: Skipping because of failed dependencies
Notice: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_data.sql]: Dependency Exec[zabbix_server_create.sql] has failures: true
Warning: /Stage[main]/Zabbix::Database::Postgresql/Exec[zabbix_server_data.sql]: Skipping because of failed dependencies

Any additional information you'd like to impart

I Will try to fix it with a pullrequest :D

RaphaelNeumann added a commit to InfiniTecnologia/puppet-zabbix that referenced this issue Jun 21, 2017
Add a pg_hba rule to aways add this rule for allow zabbix server connect to database. voxpupuli#411
bastelfreak pushed a commit that referenced this issue Jun 26, 2017
* Add pg_hba rule to allow zabbix server

Add a pg_hba rule to aways add this rule for allow zabbix server connect to database. #411

* Rake fix

* Add database_host_ip param

* Include validation for database host ip and server ip

* include spec for zabbix_database in another server than zabbix_server and zabbix_web

* fix  param

* Include databsse_host_ip on spec for multiple module

* allow create pg_hba rule for zabbix_server alson when database_host is not setted

* if fixing

* Spell fix

* fix spell
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

No branches or pull requests

1 participant