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 Stdlib::Port::Unprivileged $database_port = 5432,
2223 $database_path = $zabbix::params::database_path,
24+ Boolean $manage_timescale = false ,
2325) inherits zabbix::params {
2426 assert_private()
2527
108110 provider => ' shell' ,
109111 require => Exec[' update_pgpass' ],
110112 }
113+ if $manage_timescale {
114+ # Enable timescaledb
115+ $_timescaledb_sql = [
116+ " cd ${schema_path} " ,
117+ " && psql -h '${database_host} '" ,
118+ " -U '${database_user} '" ,
119+ " -d '${database_name} '" ,
120+ ' -f timescaledb.sql' ,
121+ ' && touch /etc/zabbix/.timescaledb.done' ,
122+ ]
123+ exec { 'zabbix_timescaledb.sql' :
124+ command => $_timescaledb_sql.join(' ' ),
125+ path => " /bin:/usr/bin:/usr/local/sbin:/usr/local/bin:${database_path} " ,
126+ unless => ' test -f /etc/zabbix/.timescaledb.done' ,
127+ provider => ' shell' ,
128+ require => [
129+ Exec[' update_pgpass' ],
130+ Exec[' zabbix_server_data.sql' ],
131+ ],
132+ }
133+ }
111134 }
112135 default: {
113136 fail ' We do not work.'
You can’t perform that action at this time.
0 commit comments