Comments (6)
Hi simon-kerckhof,
Thank you for making time to create this issue!
Will take a look at it.
Kind regards,
Werner
from puppet-zabbix.
Hi simon-kerckhof,
I just pushed an fix for this.
Please let me know if something isn't working as it supposed to.
Kind regards,
Werner
from puppet-zabbix.
puppetlabs/postgresql v4.3.0
wdijkerman/zabbix v1.4.0
same issue on postgresql with {data,images,schema}.sql
from puppet-zabbix.
Hi PHaroZ,
So these are also found on the system as {data,images,schema}.sql.gz ?
Kind regards,
Werner
from puppet-zabbix.
yep, I've juste edit my postgres.pp as mentioned by simon.
It results as
cat manifests/database/postgresql.pp
# == Class: zabbix::database::postgresql
#
# This will install and load the sql files for the tables
# and other data which is needed for zabbix.
#
# Please note:
# This class will be called from zabbix::database. No need for calling
# this class manually.
#
# === Authors
#
# Author Name: [email protected]
#
# === Copyright
#
# Copyright 2014 Werner Dijkerman
#
class zabbix::database::postgresql (
$zabbix_type = '',
$zabbix_version = $zabbix::params::zabbix_version,
$database_schema_path = '',
$database_name = '',
$database_user = '',
$database_password = '',
$database_host = '',
$database_path = $zabbix::params::database_path,
) {
# Allow to customize the path to the Database Schema,
if ! $database_schema_path {
case $::operatingsystem {
'centos','redhat','oraclelinux' : {
$schema_path = "/usr/share/doc/zabbix-*-pgsql-${zabbix_version}*/create"
}
default : {
$schema_path = '/usr/share/zabbix-*-pgsql'
}
}
}else {
$schema_path = $database_schema_path
}
exec { 'update_pgpass':
command => "echo ${database_host}:5432:${database_name}:${database_user}:${database_password} >> /root/.pgpass",
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
unless => "grep \"${database_host}:5432:${database_name}:${database_user}:${database_password}\" /root/.pgpass",
require => File['/root/.pgpass'],
}
file { '/root/.pgpass':
ensure => present,
mode => '0600',
owner => 'root',
group => 'root',
require => Class['postgresql::client'],
}
case $zabbix_type {
'proxy': {
exec { 'zabbix_proxy_create.sql':
command => "cd ${schema_path} && if [ -f schema.sql.gz ]; then gunzip schema.sql.gz ; fi && psql -h '${database_host}' -U '${database_user}' -d '${database_name}' -f schema.sql && touch /etc/zabbix/.schema.done",
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
unless => 'test -f /etc/zabbix/.schema.done',
provider => 'shell',
require => [
Exec['update_pgpass'],
],
}
}
'server': {
exec { 'zabbix_server_create.sql':
command => "cd ${schema_path} && if [ -f schema.sql.gz ]; then gunzip schema.sql.gz ; fi && psql -h '${database_host}' -U '${database_user}' -d '${database_name}' -f schema.sql && touch /etc/zabbix/.schema.done",
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
unless => 'test -f /etc/zabbix/.schema.done',
provider => 'shell',
require => [
Exec['update_pgpass'],
],
} ->
exec { 'zabbix_server_images.sql':
command => "cd ${schema_path} && if [ -f images.sql.gz ]; then gunzip images.sql.gz ; fi && psql -h '${database_host}' -U '${database_user}' -d '${database_name}' -f images.sql && touch /etc/zabbix/.images.done",
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
unless => 'test -f /etc/zabbix/.images.done',
provider => 'shell',
require => [
Exec['update_pgpass'],
],
} ->
exec { 'zabbix_server_data.sql':
command => "cd ${schema_path} && if [ -f data.sql.gz ]; then gunzip data.sql.gz ; fi && psql -h '${database_host}' -U '${database_user}' -d '${database_name}' -f data.sql && touch /etc/zabbix/.data.done",
path => "/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path}",
unless => 'test -f /etc/zabbix/.data.done',
provider => 'shell',
require => [
Exec['update_pgpass'],
],
}
}
default: {
fail 'We do not work.'
}
}
}
from puppet-zabbix.
Hi PHaroZ,
It is also done now in the module.
Kind regards,
Werner
from puppet-zabbix.
Related Issues (20)
- Error when parameter zabbix::web::manage_resources: true
- Old template name hard coded
- When specifying a zabbix::agent::zbx_macro you cannot select a type other than plaintext.
- Module forces v5 repos when running on a non windows OS HOT 5
- Set DirectoryIndex in the zabbix module
- RHEL 9 packages fails to install
- Apache module version 9 support HOT 1
- overwriting module params HOT 6
- Can't contact API, getting 302 because of corporate proxy
- Windows zabbix agent could not be installed if C:\programdata\zabbix folder missing
- Support for Deferred functions / lookups for sensitive parameters
- database schema creation fails because create.sql.gz appears to now be named schema.sql.gz HOT 1
- Outdated tag 9.2 HOT 2
- Module dependency version cause Acceptance test failure
- puppet aio dependency in acceptanse test
- Add Ubuntu 22.04 support
- Use shared example in acceptance
- Refactoring test HOT 1
- zabbix::proxy on 10.0.0 fails to build HOT 1
- Zabbix Proxy 10.0.0 redeclare issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-zabbix.