Add configuration of solidfire plugin

Change-Id: Ib6f0f0f832224f50bfe36d2371b4c51c8ae8ab30
This commit is contained in:
Brad Klein 2016-08-04 07:30:48 -06:00
parent 16edf3ad1e
commit 0b8492dd22
4 changed files with 78 additions and 1 deletions

View File

@ -0,0 +1,27 @@
# == Defined Type: monasca::checks::instances::solidfire
#
# Configure monasca plugin yaml file for solidfire.
#
# === Parameters:
#
# [*admin_name*]
# (Required) Name of the cluster administrator.
#
# [*admin_password*]
# (Required) Password of the cluster administrator.
#
# [*cluster_mvip*]
# (Required) Management VIP of the cluster.
#
define monasca::checks::instances::solidfire (
$admin_name,
$admin_password,
$cluster_mvip,
) {
$conf_dir = $::monasca::agent::conf_dir
concat::fragment { "${title}_solidfire_instance":
target => "${conf_dir}/solidfire.yaml",
content => template('monasca/checks/solidfire.erb'),
order => '1',
}
}

View File

@ -0,0 +1,46 @@
# == Class: monasca::checks::solidfire
#
# Sets up the monasca solidfire agent plugin.
#
# === Parameters
#
# [*instances*]
# (Required) A hash of instances for the solidfire plugin. Each instance
# should be a hash of the check's parameters. Parameters for the solidfire
# check are (all required):
#
# cluster_name (the instance key): The name of the cluster.
# admin_name: Name of the cluster administrator.
# admin_password: Password of the cluster administrator.
# cluster_mvip: Management VIP of the cluster.
#
# Example:
#
# instances:
# rack_d_cluster:
# admin_name: monasca_admin
# admin_password: secret_password
# cluster_mvip: 192.168.1.1
#
class monasca::checks::solidfire(
$instances,
){
$conf_dir = $::monasca::agent::conf_dir
if($instances){
Concat["${conf_dir}/solidfire.yaml"] ~> Service['monasca-agent']
concat { "${conf_dir}/solidfire.yaml":
owner => 'root',
group => $::monasca::group,
mode => '0640',
warn => true,
require => File[$conf_dir],
}
concat::fragment { 'solidfire_header':
target => "${conf_dir}/solidfire.yaml",
order => '0',
content => "---\ninit_config: null\ninstances:\n",
}
create_resources('monasca::checks::instances::solidfire', $instances)
}
}

View File

@ -13,4 +13,4 @@
<%- end -%>
<%- if @dimensions -%>
dimensions: <%= @dimensions %>
<%- end -%>
<%- end -%>

View File

@ -0,0 +1,4 @@
- name: <%= @title %>
username: <%= @admin_name %>
password: '<%= @admin_password %>'
mvip: <%= @cluster_mvip %>