Skip to content
This repository has been archived by the owner on Jan 31, 2018. It is now read-only.

Commit

Permalink
Fixed puppet-lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mvisonneau committed Jan 8, 2015
1 parent 1be50a2 commit c1799bb
Show file tree
Hide file tree
Showing 5 changed files with 131 additions and 47 deletions.
45 changes: 35 additions & 10 deletions manifests/client.pp
Original file line number Diff line number Diff line change
@@ -1,19 +1,44 @@
# == Class: centreon::client
#
# This class should be applied to the hosts you want to be monitored
##
# === Parameters
#
# None
#
# === Variables
#
# None
#
# === Examples
#
# include centreon::client
#
# === Authors
#
# knak - Maxime VISONNEAU <[email protected]>
#
# === Copyright
#
# Apache V2 License
#

class centreon::client {
include centreon::packages

# Host declaration
@@centreon_host { $hostname:
alias => $hostname,
address => $ipaddress,
template => "generic-host",
ensure => present,
@@centreon_host { $::hostname:
ensure => present,
alias => $::hostname,
address => $::ipaddress,
template => 'generic-host',
}

# Ping service declaration
@@centreon_service { "check_ping_${hostname}":
hostname => "$hostname",
template => "Ping-LAN",
description => "ping",
ensure => present,
@@centreon_service { "check_ping_${::hostname}":
ensure => present,
hostname => $::hostname,
template => 'Ping-LAN',
description => 'ping',
}
}
24 changes: 6 additions & 18 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
# == Class: centreon
#
# This class enables you to provision one or several Centreon servers with Puppet, using Centreon CLAPI.
#
# This class enables you to provision one or several Centreon servers
# with Puppet, using Centreon CLAPI.
##
# === Parameters
#
# Document parameters here.
#
# [*sample_parameter*]
# Explanation of what this parameter affects and what it defaults to.
# e.g. "Specify one or more upstream ntp servers as an array."
#
# === Variables
#
# Here you should define a list of variables that this module would require.
#
# [*sample_variable*]
# Explanation of how this variable affects the funtion of this class and if
# it has a default. e.g. "The parameter enc_ntp_servers must be set by the
# External Node Classifier as a comma separated list of hostnames." (Note,
# global variables should be avoided in favor of class parameters as
# of Puppet 2.6.)
#
# === Examples
#
# class { centreon:
# servers => [ 'pool.ntp.org', 'ntp.local.company.com' ],
# }
#
#
# === Authors
#
# Maxime VISONNEAU <[email protected]>
# knak - Maxime VISONNEAU <[email protected]>
#
# === Copyright
#
Expand All @@ -38,4 +26,4 @@

class centreon {
include centreon::server, centreon::client, centreon::packages
}
}
34 changes: 32 additions & 2 deletions manifests/packages.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,37 @@
# == Class: centreon::packages
#
# This class should be applied to the hosts you want to be monitored
# It will installed some required plugins
##
# === Parameters
#
# None
#
# === Variables
#
# None
#
# === Examples
#
# include centreon::packages
#
# === Authors
#
# knak - Maxime VISONNEAU <[email protected]>
#
# === Copyright
#
# Apache V2 License
#

class centreon::packages {
$centreonPackages = [ 'nagios-plugins','nagios-plugins-standard','nagios-plugins-basic' ]
$centreonPackages = [
'nagios-plugins',
'nagios-plugins-standard',
'nagios-plugins-basic'
]

package { $centreonPackages:
package { $centreonPackages:
ensure => installed,
}
}
47 changes: 36 additions & 11 deletions manifests/server.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
# == Class: centreon::server
#
# This class is used in order to configure the centreon server using CLAPI.
#
# === Parameters
#
#
#
# === Variables
#
#
#
# === Examples
#
#
#
# === Authors
#
# knak - Maxime VISONNEAU <[email protected]>
#
# === Copyright
#
# Apache V2 License
#

class centreon::server(
$clapi_binaries = '/usr/local/centreon/www/modules/centreon-clapi/core', # CLAPI Binaries path
$clapi_username = 'admin', # CLAPI Username
$clapi_password = 'password', # CLAPI Password
$clapi_export_file = '/tmp/clapi.conf', # CLAPI Export file
$clapi_log_file = '/var/log/centpollers.log', # CLAPI Log file
$poller_name = 'central', # Poller name
$clapi_binaries = '/usr/local/centreon/www/modules/centreon-clapi/core',
$clapi_username = 'admin',
$clapi_password = 'password',
$clapi_export_file = '/tmp/clapi.conf',
$clapi_log_file = '/var/log/centpollers.log',
$poller_name = 'central',
) {

include centreon::packages
Expand Down Expand Up @@ -35,8 +60,8 @@
status => '/etc/init.d/centpollers status', # Dummy but needed
}

file { "/etc/init.d/centpollers":
path => "/etc/init.d/centpollers",
file { '/etc/init.d/centpollers':
path => '/etc/init.d/centpollers',
owner => 'root',
group => 'root',
mode => '0755',
Expand All @@ -46,8 +71,8 @@

file { $clapi_export_file:
ensure => present,
owner => 'root',
group => 'root',
mode => '0700',
owner => 'root',
group => 'root',
mode => '0700',
}
}
28 changes: 22 additions & 6 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
{
"name": "knak-centreon",
"version": "0.1.1",
"version": "0.1.2",
"author": "knak",
"license": "Apache-2.0",
"summary": "Management of Centreon provisioning",
"license": "Apache 2.0",
"source": "https://github.com/mvisonneau/puppet-centreon.git",
"project_page": "https://github.com/mvisonneau/puppet-centreon",
"issues_url": "https://github.com/mvisonneau/puppet-centreon/issues",
"dependencies": [
"tags": ["centreon", "monitoring", "provisioning", "clapi"],
"operatingsystem_support": [
{
"operatingsystem":"RedHat",
"operatingsystemrelease":[ "6.6", "7.0" ]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [ "6.6", "7.0" ]
},
{
"name": "puppetlabs-stdlib",
"version_range": ">= 1.0.0"
"operatingsystem": "Debian",
"operatingsystemrelease": [ "7" ]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [ "14.04", "12.04" ]
}
],
"dependencies": [
{ "name": "puppetlabs/stdlib", "version_requirement": ">=3.2.0" }
]
}
}

0 comments on commit c1799bb

Please sign in to comment.