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

Module expects postgresql to be install on same machine #18

Closed
lucas42 opened this issue Dec 4, 2014 · 2 comments
Closed

Module expects postgresql to be install on same machine #18

lucas42 opened this issue Dec 4, 2014 · 2 comments

Comments

@lucas42
Copy link
Contributor

lucas42 commented Dec 4, 2014

I've had trouble attempting to use this module with postgresql on another machine.

class { 'zabbix::server':
  zabbix_url => 'zabbix.example.com',
  dbhost     => '10.0.0.2',
}

(Where the machine at 10.0.0.2 is already set up running postgresql).

I get the following types of puppet errors:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Postgresql_psql[Check for existence of db 'zabbix-server'] { require => Class[Postgresql::Server::Service] }, because Class[Postgresql::Server::Service] doesn't seem to be in the catalog

And

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Invalid relationship: Postgresql_psql[CREATE ROLE "zabbix-server" ENCRYPTED PASSWORD '**redacted**' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER  CONNECTION LIMIT -1] { require => Class[Postgresql::Server] }, because Class[Postgresql::Server] doesn't seem to be in the catalog

This is because the module has require statements which reference the postgreqsl classes, assuming they're going to be on the same machine. If I add include postgresql::server to my manifest, then the errors go away. (But then I end up postgresql configured on the localhost, not remotely)

@dj-wasabi
Copy link
Contributor

Hi lucas42,

Thanks for making time to create this issue. Yes, I'm aware that this module assumes everything is installed on the same host. I will take a look at the pull request you've created.

One other possible way that might be working for you. On the zabbix-server node:

class { 'zabbix::server':
   zabbix_url      => 'zabbix.example.com',
   manage_database => false,
   dbname          => 'zabbix',
   dbuser          => 'zabbix-user',
   dbpass          => 'zabbix-pass',
   dbhost          => '10.0.0.2',
 } 

And on the database node:

class { 'postgresql::server': }
class { 'zabbix::database':
   manage_database => true,
   dbtype          => 'postgresql',
   db_name         => 'zabbix',
   db_user         => 'zabbix-user',
   db_pass         => 'zabbix-pass',
   db_host         => 'localhost',
 } 

With the 1.0.0. version I'll split the "server" part into 3 pieces:

  • zabbix-web
  • zabbix-server
  • database

What I described above will probably the way to split it.

@dj-wasabi
Copy link
Contributor

Hi Lucas,

As you already provided your own solution for this problem, I'll close this issue.
If you have any problems or questions, don't hesitate to open new issue (Or pull request ;-)).

Kind regards,
Werner

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

2 participants