File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 99# @param database_host Hostname to use to connect to the database
1010# @param database_port Database port to be used for the import process.
1111# @param database_path Path to the database executable
12+ # @param manage_timescale Import the timescaledb sql file?
1213# @author Werner Dijkerman <[email protected] >1314class zabbix::database::postgresql (
1415 $zabbix_type = ' ' ,
2021 $database_host = ' ' ,
2122 Optional[Stdlib::Port::Unprivileged] $database_port = undef ,
2223 $database_path = $zabbix::params::database_path,
24+ Boolean $manage_timescale = false ,
2325) inherits zabbix::params {
2426 assert_private()
2527
110112 provider => ' shell' ,
111113 require => Exec[' update_pgpass' ],
112114 }
115+ if $manage_timescale {
116+ # Enable timescaledb
117+ $_timescaledb_sql = [
118+ " cd ${schema_path} " ,
119+ " && psql -h '${database_host} '" ,
120+ " -U '${database_user} '" ,
121+ " -d '${database_name} '" ,
122+ ' -f timescaledb.sql' ,
123+ ' && touch /etc/zabbix/.timescaledb.done' ,
124+ ]
125+ exec { 'zabbix_timescaledb.sql' :
126+ command => $_timescaledb_sql.join(' ' ),
127+ path => " /bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path} " ,
128+ unless => ' test -f /etc/zabbix/.timescaledb.done' ,
129+ provider => ' shell' ,
130+ require => [
131+ Exec[' update_pgpass' ],
132+ Exec[' zabbix_server_data.sql' ],
133+ ],
134+ }
135+ }
113136 }
114137 default: {
115138 fail ' We do not work.'
You can’t perform that action at this time.
0 commit comments