Skip to content

Commit

Permalink
fix: add documentation to satisfy linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Friderici committed Mar 17, 2023
1 parent 3460c63 commit dd656a7
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_application/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_application).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider for Zabbix application using the Zabbix API.'
confine feature: :zabbixapi

def template_id
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_host/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_host).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider for managing Zabbix hosts. It uses the Zabbix API to create, read, update and delete hosts.'
confine feature: :zabbixapi

def self.instances
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_hostgroup/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_hostgroup).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider for managing Zabbix hostgroups. It defines methods to create, check if exists, and destroy Zabbix hostgroups using the Zabbix API.'
confine feature: :zabbixapi

def self.instances
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_proxy/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_proxy).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider for managing Zabbix proxies. It uses the Zabbix API to create, read, update and delete hosts, as well as changing them between active and passive modes.'
confine feature: :zabbixapi

def initialize(value = {})
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_template/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_template).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider that manages Zabbix templates by importing and exporting them in XML format, and creating, updating, or deleting various Zabbix configuration objects. It includes conditional logic based on the Zabbix version being used.'
confine feature: :zabbixapi

def create
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_template_host/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_template_host).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider that manages the association between Zabbix templates and hosts. It allows creating, checking the existence of, and deleting the association between a Zabbix template and a host, using the Zabbix API.'
confine feature: :zabbixapi
def template_name
@template_name ||= @resource[:name].split('@')[0]
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/provider/zabbix_userparameters/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require_relative '../zabbix'
Puppet::Type.type(:zabbix_userparameters).provide(:ruby, parent: Puppet::Provider::Zabbix) do
desc 'Puppet provider that manages Zabbix user parameters. It allows users to define custom monitoring parameters in Zabbix, and provides methods for creating and checking the existence of a user parameter. It also has a placeholder method for destroying the user parameter.'
confine feature: :zabbixapi

def create
Expand Down
4 changes: 3 additions & 1 deletion lib/puppet/type/zabbix_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
Puppet::Type.newtype(:zabbix_application) do
@doc = %q(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.
)

ensurable do
desc "Specifies whether the zabbix application should be 'present' or 'absent'."
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/zabbix_host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Puppet::Type.newtype(:zabbix_host) do
ensurable do
desc "Specify whether the zabbix_host resource should be 'present' or 'absent' on the system."
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/zabbix_hostgroup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@doc = 'Manage zabbix hostgroups'

ensurable do
desc "The desired state of the Zabbix hostgroup. Valid values are 'present' to ensure the group exists or 'absent' to ensure it is removed."
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/zabbix_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Puppet::Type.newtype(:zabbix_proxy) do
ensurable do
desc "Specifies whether the zabbix proxy should be 'present' or 'absent'."
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/zabbix_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Puppet::Type.newtype(:zabbix_template) do
ensurable do
desc "Specifies whether the zabbix_template should exist or not. Valid values are 'present' and 'absent'."
defaultvalues
defaultto :present

Expand Down
17 changes: 10 additions & 7 deletions lib/puppet/type/zabbix_template_host.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# frozen_string_literal: true

Puppet::Type.newtype(:zabbix_template_host) do
@doc = <<-DOC
@doc = %q{
Link or Unlink template to host. Only for Zabbix < 6.0!
Example.
Name should be in the format of "template_name@hostname"
zabbix_template_host{ 'mysql_template@db1':
ensure => present,
}
DOC
Example:
zabbix_template_host{ 'mysql_template@db1':
ensure => present,
}
(Name should be in the format of "template_name@hostname")
}

ensurable do
desc 'Specifies whether the Zabbix template should be linked or unlinked to the host.'
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/zabbix_userparameters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', '..'))
Puppet::Type.newtype(:zabbix_userparameters) do
ensurable do
desc 'Specifies whether the zabbix_userparameters should exist.'
defaultvalues
defaultto :present
end
Expand Down
1 change: 1 addition & 0 deletions types/historyics.pp
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# @summary Type for size values in bytes (also allows k/K and m/M as appendix)
type Zabbix::Historyics = Optional[Pattern[/^\d+[k|K|m|M]?$/]]

0 comments on commit dd656a7

Please sign in to comment.