Configure tox environments
Change-Id: Id5ea3ce64d1b3473b739d8f579581c37cc0207a6
This commit is contained in:
parent
824e55f297
commit
d1355e5f45
|
@ -2,3 +2,7 @@
|
|||
*.noarch.rpm
|
||||
repositories/centos/*.rpm
|
||||
repositories/ubuntu/*.deb
|
||||
.bundled_gems/
|
||||
.bundle/
|
||||
Gemfile.lock
|
||||
.tox/
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake'
|
||||
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
|
||||
gem 'puppetlabs_spec_helper'
|
||||
# Need to use master branch of puppet-lint because of
|
||||
# https://github.com/rodjek/puppet-lint/issues/355
|
||||
gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'
|
||||
end
|
|
@ -0,0 +1,13 @@
|
|||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
|
||||
desc "Run lint, and syntax tests."
|
||||
task :test => [
|
||||
:lint,
|
||||
:syntax,
|
||||
]
|
|
@ -0,0 +1,23 @@
|
|||
# Copyright 2015 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
source 'https://rubygems.org'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rake'
|
||||
gem "puppet", ENV['PUPPET_VERSION'] || '~> 3.4.0'
|
||||
gem 'puppetlabs_spec_helper'
|
||||
# Need to use master branch of puppet-lint because of
|
||||
# https://github.com/rodjek/puppet-lint/issues/355
|
||||
gem 'puppet-lint', :git => 'https://github.com/rodjek/puppet-lint.git'
|
||||
end
|
|
@ -0,0 +1,17 @@
|
|||
require 'puppetlabs_spec_helper/rake_tasks'
|
||||
require 'puppet-lint/tasks/puppet-lint'
|
||||
require 'puppet-syntax/tasks/puppet-syntax'
|
||||
|
||||
PuppetLint.configuration.fail_on_warnings = true
|
||||
PuppetLint.configuration.send('disable_80chars')
|
||||
PuppetLint.configuration.send('disable_class_inherits_from_params_class')
|
||||
PuppetLint.configuration.send('disable_class_parameter_defaults')
|
||||
PuppetLint.configuration.send('disable_autoloader_layout')
|
||||
|
||||
desc "Run lint, and syntax and spec tests."
|
||||
task :test => [
|
||||
:lint,
|
||||
:syntax,
|
||||
:spec,
|
||||
]
|
||||
|
|
@ -18,15 +18,14 @@ define plugin_zabbix_monitoring_extreme_networks::extreme_host(
|
|||
) {
|
||||
|
||||
$host = split($name,':')
|
||||
|
||||
if size($host) == 2 {
|
||||
plugin_zabbix_host { $host[0]:
|
||||
host => $host[0],
|
||||
type => 2,
|
||||
ip => $host[1],
|
||||
port => '161',
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
groups => $host_group,
|
||||
host => $host[0],
|
||||
type => 2,
|
||||
ip => $host[1],
|
||||
port => '161',
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
groups => $host_group,
|
||||
}
|
||||
plugin_zabbix_template_link { "${host[0]} Template Extreme Networks":
|
||||
host => $host[0],
|
||||
|
|
|
@ -21,20 +21,20 @@ class plugin_zabbix_monitoring_extreme_networks(
|
|||
include plugin_zabbix::params
|
||||
|
||||
file { '/etc/zabbix/import/Template_Extreme_Networks.xml':
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/Template_Extreme_Networks.xml',
|
||||
ensure => present,
|
||||
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/Template_Extreme_Networks.xml',
|
||||
}
|
||||
|
||||
plugin_zabbix_configuration_import { 'Template_Extreme_Networks.xml Import':
|
||||
ensure => present,
|
||||
xml_file => '/etc/zabbix/import/Template_Extreme_Networks.xml',
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
require => File['/etc/zabbix/import/Template_Extreme_Networks.xml'],
|
||||
ensure => present,
|
||||
xml_file => '/etc/zabbix/import/Template_Extreme_Networks.xml',
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
require => File['/etc/zabbix/import/Template_Extreme_Networks.xml'],
|
||||
}
|
||||
|
||||
plugin_zabbix_hostgroup {$host_group:
|
||||
ensure => present,
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
ensure => present,
|
||||
api => $plugin_zabbix::params::api_hash,
|
||||
}
|
||||
|
||||
$zabbix_monitoring_extreme_hash = hiera('zabbix_monitoring_extreme_networks')
|
||||
|
|
|
@ -16,33 +16,33 @@
|
|||
class plugin_zabbix_monitoring_extreme_networks::snmptt_config {
|
||||
|
||||
file { '/etc/snmp/snmptt.conf.d':
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
ensure => directory,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0755',
|
||||
}
|
||||
|
||||
file { '/etc/snmp/snmptt.conf.d/extreme_networks.conf':
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/snmptt_extreme_networks.conf',
|
||||
require => File['/etc/snmp/snmptt.conf.d'],
|
||||
ensure => present,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0644',
|
||||
source => 'puppet:///modules/plugin_zabbix_monitoring_extreme_networks/snmptt_extreme_networks.conf',
|
||||
require => File['/etc/snmp/snmptt.conf.d'],
|
||||
}
|
||||
|
||||
file_line { 'add extreme_networks.conf config to snmptt.ini':
|
||||
path => '/etc/snmp/snmptt.ini',
|
||||
after => 'snmptt_conf_files = <<END',
|
||||
line => '/etc/snmp/snmptt.conf.d/extreme_networks.conf',
|
||||
require => File['/etc/snmp/snmptt.conf.d/extreme_networks.conf'],
|
||||
notify => Service['snmptt'],
|
||||
path => '/etc/snmp/snmptt.ini',
|
||||
after => 'snmptt_conf_files = <<END',
|
||||
line => '/etc/snmp/snmptt.conf.d/extreme_networks.conf',
|
||||
require => File['/etc/snmp/snmptt.conf.d/extreme_networks.conf'],
|
||||
notify => Service['snmptt'],
|
||||
}
|
||||
|
||||
service { 'snmptt':
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasstatus => false,
|
||||
ensure => running,
|
||||
enable => true,
|
||||
hasstatus => false,
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
Sphinx
|
||||
fuel-plugin-builder>=2.0.4
|
|
@ -0,0 +1,51 @@
|
|||
[tox]
|
||||
envlist = manifests,plugin_zabbix_monitoring_extreme_networks,build_plugin
|
||||
skipsdist = True
|
||||
|
||||
[testenv]
|
||||
deps = -r{toxinidir}/test-requirements.txt
|
||||
passenv = HOME
|
||||
|
||||
[testenv:manifests]
|
||||
changedir = {toxinidir}/deployment_scripts/puppet/manifests
|
||||
whitelist_externals =
|
||||
bundle
|
||||
mkdir
|
||||
commands =
|
||||
mkdir -p {toxinidir}/.bundled_gems
|
||||
bundle install --path {toxinidir}/.bundled_gems
|
||||
bundle exec rake test
|
||||
|
||||
[testenv:plugin_zabbix_monitoring_extreme_networks]
|
||||
changedir = {toxinidir}/deployment_scripts/puppet/modules/{envname}
|
||||
whitelist_externals =
|
||||
bundle
|
||||
mkdir
|
||||
commands =
|
||||
mkdir -p {toxinidir}/.bundled_gems
|
||||
bundle install --path {toxinidir}/.bundled_gems
|
||||
bundle exec rake test
|
||||
|
||||
[testenv:build_plugin]
|
||||
changedir = {toxinidir}
|
||||
whitelist_externals=
|
||||
fpb
|
||||
rm
|
||||
commands =
|
||||
rm -rf .build
|
||||
rm -rf repositories/ubuntu/*.deb
|
||||
rm -rf repositories/centos/*.rpm
|
||||
fpb --check {toxinidir} --debug
|
||||
fpb --build {toxinidir} --debug
|
||||
|
||||
[testenv:docs]
|
||||
changedir = {toxinidir}/doc/plugin-guide
|
||||
whitelist_externals = make
|
||||
commands =
|
||||
make clean html SPHINXOPTS=-W
|
||||
|
||||
[testenv:qa_docs]
|
||||
changedir = {toxinidir}/doc/qa
|
||||
whitelist_externals = make
|
||||
commands =
|
||||
make clean html SPHINXOPTS=-W
|
Loading…
Reference in New Issue