Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ jobs:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3
with:
beaker_facter: 'zabbix_version:Zabbix:5.0,6.0,7.0'
beaker_facter: 'zabbix_version:Zabbix:6.0,7.0'
unit_runs_on: 'cern-self-hosted'
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ spec/spec_helper.rb:
- parameter_documentation
.github/workflows/ci.yml:
with:
beaker_facter: 'zabbix_version:Zabbix:5.0,6.0,7.0'
beaker_facter: 'zabbix_version:Zabbix:6.0,7.0'
unit_runs_on: 'cern-self-hosted'
92 changes: 1 addition & 91 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@

### Resource types

* [`zabbix_application`](#zabbix_application): Manage zabbix applications Example: zabbix_application{"app1": ensure => present, template => 'template1', } It Raise exceptio
* [`zabbix_host`](#zabbix_host): Manage zabbix hosts
* [`zabbix_hostgroup`](#zabbix_hostgroup): Manage zabbix hostgroups
* [`zabbix_proxy`](#zabbix_proxy): Manage zabbix proxies
* [`zabbix_template`](#zabbix_template): Manage zabbix templates
* [`zabbix_template_host`](#zabbix_template_host): Link or Unlink template to host. Only for Zabbix < 6.0! Example: zabbix_template_host{ 'mysql_template@db1': ensure => present, } Na
* [`zabbix_userparameters`](#zabbix_userparameters): Manage zabbix user templates

### Data types
Expand Down Expand Up @@ -4106,7 +4104,7 @@ Default value: `$zabbix::params::database_path`

Data type: `Any`

This is the zabbix version. Example: 5.0
This is the zabbix version. Example: 7.0

Default value: `$zabbix::params::zabbix_version`

Expand Down Expand Up @@ -6065,52 +6063,6 @@ Default value: `'0644'`

## Resource types

### <a name="zabbix_application"></a>`zabbix_application`

Manage zabbix applications

Example:
zabbix_application{"app1":
ensure => present,
template => 'template1',
}
It Raise exception on deleting an application which is a part of used template.

#### Properties

The following properties are available in the `zabbix_application` type.

##### `ensure`

Valid values: `present`, `absent`

The basic property that the resource should be in.

Default value: `present`

#### Parameters

The following parameters are available in the `zabbix_application` type.

* [`name`](#-zabbix_application--name)
* [`provider`](#-zabbix_application--provider)
* [`template`](#-zabbix_application--template)

##### <a name="-zabbix_application--name"></a>`name`

namevar

application name

##### <a name="-zabbix_application--provider"></a>`provider`

The specific backend to use for this `zabbix_application` resource. You will seldom need to specify this --- Puppet will
usually discover the appropriate provider for your platform.

##### <a name="-zabbix_application--template"></a>`template`

template to which the application is linked

### <a name="zabbix_host"></a>`zabbix_host`

Manage zabbix hosts
Expand Down Expand Up @@ -6381,48 +6333,6 @@ Template source file.

Zabbix version that the template will be installed on.

### <a name="zabbix_template_host"></a>`zabbix_template_host`

Link or Unlink template to host. Only for Zabbix < 6.0!

Example:
zabbix_template_host{ 'mysql_template@db1':
ensure => present,
}
Name should be in the format of "template_name@hostname"

#### Properties

The following properties are available in the `zabbix_template_host` type.

##### `ensure`

Valid values: `present`, `absent`

The basic property that the resource should be in.

Default value: `present`

#### Parameters

The following parameters are available in the `zabbix_template_host` type.

* [`name`](#-zabbix_template_host--name)
* [`provider`](#-zabbix_template_host--provider)

##### <a name="-zabbix_template_host--name"></a>`name`

Valid values: `%r{.+@.+}`

namevar

template_name@host_name

##### <a name="-zabbix_template_host--provider"></a>`provider`

The specific backend to use for this `zabbix_template_host` resource. You will seldom need to specify this --- Puppet
will usually discover the appropriate provider for your platform.

### <a name="zabbix_userparameters"></a>`zabbix_userparameters`

Manage zabbix user templates
Expand Down
32 changes: 0 additions & 32 deletions lib/puppet/provider/zabbix_application/ruby.rb

This file was deleted.

40 changes: 0 additions & 40 deletions lib/puppet/provider/zabbix_template_host/ruby.rb

This file was deleted.

30 changes: 0 additions & 30 deletions lib/puppet/type/zabbix_application.rb

This file was deleted.

34 changes: 0 additions & 34 deletions lib/puppet/type/zabbix_template_host.rb

This file was deleted.

16 changes: 3 additions & 13 deletions manifests/database/mysql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
assert_private()

if ($database_schema_path == false) or ($database_schema_path == '') {
if versioncmp($zabbix_version, '6.0') >= 0 {
$schema_path = '/usr/share/zabbix-sql-scripts/mysql/'
} else {
$schema_path = '/usr/share/doc/zabbix-*-mysql*'
}
$schema_path = '/usr/share/zabbix-sql-scripts/mysql/'
}
else {
$schema_path = $database_schema_path
Expand All @@ -42,16 +38,10 @@

case $zabbix_type {
'proxy': {
$zabbix_proxy_create_sql = versioncmp($zabbix_version, '6.0') >= 0 ? {
true => "cd ${schema_path} && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < proxy.sql && touch /etc/zabbix/.schema.done",
false => "cd ${schema_path} && if [ -f schema.sql.gz ]; then gunzip -f schema.sql.gz ; fi && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < schema.sql && touch /etc/zabbix/.schema.done"
}
$zabbix_proxy_create_sql = "cd ${schema_path} && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < proxy.sql && touch /etc/zabbix/.schema.done"
}
default: {
$zabbix_server_create_sql = versioncmp($zabbix_version, '6.0') >= 0 ? {
true => "cd ${schema_path} && if [ -f server.sql.gz ]; then gunzip -f server.sql.gz ; fi && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < server.sql && touch /etc/zabbix/.schema.done",
false => "cd ${schema_path} && if [ -f create.sql.gz ]; then gunzip -f create.sql.gz ; fi && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < create.sql && touch /etc/zabbix/.schema.done"
}
$zabbix_server_create_sql = "cd ${schema_path} && if [ -f server.sql.gz ]; then gunzip -f server.sql.gz ; fi && mysql -h '${database_host}' -u '${database_user}' -p'${database_password}' ${port}-D '${database_name}' < server.sql && touch /etc/zabbix/.schema.done"
}
}

Expand Down
18 changes: 3 additions & 15 deletions manifests/database/postgresql.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,17 @@

if $database_schema_path != false and $database_schema_path != '' {
$schema_path = $database_schema_path
} elsif versioncmp($zabbix_version, '6.0') >= 0 {
$schema_path = '/usr/share/zabbix-sql-scripts/postgresql/'
} elsif $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
$schema_path = "/usr/share/doc/zabbix-*-pgsql-${zabbix_version}*/"
} else {
$schema_path = '/usr/share/doc/zabbix-*-pgsql'
$schema_path = '/usr/share/zabbix-sql-scripts/postgresql/'
}

$done_file = '/etc/zabbix/.schema.done'
$schema_file = case $zabbix_type {
'proxy': {
if versioncmp($zabbix_version, '6.0') >= 0 {
'proxy.sql'
} else {
'schema.sql'
}
'proxy.sql'
}
default: {
if versioncmp($zabbix_version, '6.0') >= 0 {
'server.sql'
} else {
'create.sql'
}
'server.sql'
}
}

Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
}

if downcase($facts['kernel']) == 'windows' {
$zabbix_version = '4.4.5'
$zabbix_version = '4.4.5' # FIXME
} else {
$zabbix_version = '6.0'
}
Expand Down
17 changes: 5 additions & 12 deletions manifests/proxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -361,20 +361,13 @@
}

if $manage_database {
if versioncmp($zabbix_version, '5.4') >= 0 {
package { 'zabbix-sql-scripts':
ensure => present,
require => Class['zabbix::repo'],
tag => 'zabbix',
}
package { 'zabbix-sql-scripts':
ensure => present,
require => Class['zabbix::repo'],
tag => 'zabbix',
}

# Zabbix version 5.4 uses zabbix-sql-scripts for initializing the database.
if versioncmp($zabbix_version, '5.4') >= 0 {
$zabbix_database_require = [Package["zabbix-proxy-${db}"], Package['zabbix-sql-scripts']]
} else {
$zabbix_database_require = Package["zabbix-proxy-${db}"]
}
$zabbix_database_require = [Package["zabbix-proxy-${db}"], Package['zabbix-sql-scripts']]

case $database_type {
'postgresql' : {
Expand Down
Loading
Loading