Skip to content

Commit

Permalink
remove the puppet 4 data types
Browse files Browse the repository at this point in the history
  • Loading branch information
dannygoulder committed Jun 22, 2017
1 parent b9b6208 commit 754a298
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 35 deletions.
7 changes: 4 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
fixtures:
repositories:
apt:
repo: 'git://github.com/puppetlabs/puppetlabs-apt'
repo: 'https://github.com/puppetlabs/puppetlabs-apt'
ref: '2.4.0'
stdlib:
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib'
repo: 'https://github.com/puppetlabs/puppetlabs-stdlib'
concat:
repo: 'git://github.com/puppetlabs/puppetlabs-concat'
repo: 'https://github.com/puppetlabs/puppetlabs-concat'
ref: '2.1.0'
epel:
repo: 'https://github.com/stahnma/puppet-module-epel'
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,6 @@ end

ENV['PUPPET_VERSION'].nil? ? puppetversion = '~> 4.0' : puppetversion = ENV['PUPPET_VERSION'].to_s
gem 'puppet', puppetversion, :require => false, :groups => [:test]
gem 'ruby_dep', '~> 1.3.1', :require => false

# vim: syntax=ruby
10 changes: 5 additions & 5 deletions manifests/plugin/snmp.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# https://collectd.org/wiki/index.php/Plugin:SNMP
class collectd::plugin::snmp (
Enum['present', 'absent'] $ensure = 'present',
Optional[Boolean] $manage_package = undef,
Hash[String[1], Collectd::SNMP::Data] $data = {},
Hash[String[1], Collectd::SNMP::Host] $hosts = {},
Optional[Integer[0]] $interval = undef,
$ensure = 'present',
$manage_package = undef,
$data = {},
$hosts = {},
$interval = undef,
) {

include ::collectd
Expand Down
22 changes: 12 additions & 10 deletions manifests/plugin/snmp/data.pp
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# https://collectd.org/wiki/index.php/Plugin:SNMP
define collectd::plugin::snmp::data (
String $instance,
String[1] $type,
Variant[String[1], Array[String[1], 1]] $values,
Enum['present', 'absent'] $ensure = 'present',
Optional[String[1]] $instance_prefix = undef,
Optional[Numeric] $scale = undef,
Optional[Numeric] $shift = undef,
Boolean $table = false,
Optional[Variant[String[1], Array[String[1], 1]]] $ignore = undef,
Boolean $invert_match = false,
$instance,
$type,
$values,
$ensure = 'present',
$instance_prefix = undef,
$scale = undef,
$shift = undef,
$table = false,
$ignore = undef,
$invert_match = false,
) {

include ::collectd
include ::collectd::plugin::snmp

$table_bool = str2bool($table)
$invert_match_bool = str2bool($invert_match)
$conf_dir = $collectd::plugin_conf_dir
$root_group = $collectd::root_group

Expand Down
26 changes: 13 additions & 13 deletions manifests/plugin/snmp/host.pp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# https://collectd.org/wiki/index.php/Plugin:SNMP
define collectd::plugin::snmp::host (
Variant[String[1], Array[String[1], 1]] $collect,
Enum['present', 'absent'] $ensure = 'present',
String[1] $address = $name,
Collectd::SNMP::Version $version = '1',
Optional[Integer[0]] $interval = undef,
$collect,
$ensure = 'present',
$address = $name,
$version = '1',
$interval = undef,
# SNMPv1/2c
Optional[String[1]] $community = 'public',
$community = 'public',
# SNMPv3
Optional[String[1]] $username = undef,
Optional[Collectd::SNMP::SecurityLevel] $security_level = undef,
Optional[String[1]] $context = undef,
Optional[Collectd::SNMP::AuthProtocol] $auth_protocol = undef,
Optional[String[1]] $auth_passphrase = undef,
Optional[Collectd::SNMP::PrivacyProtocol] $privacy_protocol = undef,
Optional[String[1]] $privacy_passphrase = undef,
$username = undef,
$security_level = undef,
$context = undef,
$auth_protocol = undef,
$auth_passphrase = undef,
$privacy_protocol = undef,
$privacy_passphrase = undef,
) {

include ::collectd
Expand Down
8 changes: 4 additions & 4 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@
"dependencies": [
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.6.0"
"version_requirement": ">= 4.6.0 < 5.0.0"
},
{
"name": "puppetlabs/concat",
"version_requirement": ">= 1.2.5"
"version_requirement": ">= 1.2.5 < 5.0.0"
},
{
"name": "stahnma-epel",
"version_requirement": ">= 1.2.2"
"version_requirement": ">= 1.2.2 < 2.0.0"
},
{
"name": "puppetlabs-apt",
"version_requirement": ">= 2.2.0"
"version_requirement": ">= 2.2.0 < 3.0.0"
}
]
}

0 comments on commit 754a298

Please sign in to comment.