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

override database_schema_path for AWS ami instance #428

Closed
nicohouillon opened this issue Jul 9, 2017 · 1 comment
Closed

override database_schema_path for AWS ami instance #428

nicohouillon opened this issue Jul 9, 2017 · 1 comment

Comments

@nicohouillon
Copy link

nicohouillon commented Jul 9, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4.10
  • Ruby:2.1.9
  • Distribution: redhat (ami)
  • Module version: 4.1.3

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

vagrant reload myvirtualmachine --provision

trying to force parameter in site.pp declaration

`class { 'apache':
    mpm_module => 'prefork',
  }
  include apache::mod::php

  class { 'mysql::server':
    }

  class { 'zabbix':
    zabbix_version => '3.0', 
    zabbix_url    => 'zabbix.localdomain',
    database_type => 'mysql',
    #database_schema => 'usr/share/doc/zabbix-server-mysql*',
    #database_schema_path => 'usr/share/doc/zabbix-server-mysql*',
    zabbix_timezone => 'America/Vancouver',
 
}

**_class { 'zabbix::database':
	database_schema_path => 'usr/share/doc/zabbix-server-mysql*'_**
}`

What are you seeing

by default, seems like operating system case can not find AMI even if based on redhat and ends up with the default database_schema_path file : $schema_path = '/usr/share/doc/zabbix-*-mysql'
However, this file doesn't exist.
Database schema file is well present as : $schema_path = "/usr/share/doc/zabbix-*-mysql-${zabbix_version}* but the case can not handle it .

Output log

initial error :
Error: 'cd /usr/share/doc/zabbix--pgsql && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && psql -h 'localhost' -U 'zabbix_server' -d 'zabbix_server' -f create.sql && touch /etc/zabbix/.schema.done' returned 1 instead of one of [0]
==> aws-zabbix: 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 'localhost' -U 'zabbix_server' -d 'zabbix_server' -f create.sql && touch /etc/zabbix/.schema.done' returned 1 instead of one of [0]

Error while trying to override database schema path :

Duplicate declaration: Class[Zabbix::Database] is already declared in file /tmp/vagrant-puppet/modules-764d2bc8e7b9b31e0bb0108d4568834b/zabbix/manifests/init.pp:279; cannot redeclare at /tmp/vagrant-puppet/manifests-846018e2aa141a5eb79a64b4015fc5f3/site.pp:42 at /tmp/vagrant-puppet/manifests-846018e2aa141a5eb79a64b4015fc5f3/site.pp:42:1 on node

What behaviour did you expect instead

  • how to force declaration of database_schema_path ?
  • how to properly have AMI machine caught by the case $::operatingsystem in zabbix::database classes

Any additional information you'd like to impart

puppet --verbose --debug :
...
Debug: Facter: fact "operatingsystem" has resolved to "Amazon".
...

@nicohouillon
Copy link
Author

Fixed using 4.1.3 as case use osfamily instead of operatingsystem and AWS boxes are RedHat family :)

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