From 522bfcef03e3455b1f4e358c73f4793a6b6c53c3 Mon Sep 17 00:00:00 2001 From: Bartosz Kupidura Date: Mon, 6 Jul 2015 12:52:49 +0000 Subject: [PATCH] Ensure service reloads after configuration changes Ensure init.d script uploaded after package instalation Change-Id: I68a46fe3c2bc81700e6677c730334a4004bac291 --- README.md | 1 + .../modules/plugin_zabbix_snmptrapd/manifests/init.pp | 4 +++- .../modules/plugin_zabbix_snmptrapd/manifests/params.pp | 2 ++ .../modules/plugin_zabbix_snmptrapd/manifests/snmptt.pp | 7 ++++--- metadata.yaml | 2 +- 5 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 70ae57a..07d785c 100644 --- a/README.md +++ b/README.md @@ -65,4 +65,5 @@ Contributors Dmitry Klenov (PM) Piotr Misiak (developer) Szymon Bańka (developer) +Bartosz Kupidura (developer) Alexander Zatserklyany (QA engineer) diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp index d7d42f3..a4e15a7 100644 --- a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp +++ b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/init.pp @@ -18,6 +18,8 @@ class plugin_zabbix_snmptrapd { include plugin_zabbix_snmptrapd::params $service_name = $plugin_zabbix_snmptrapd::params::service_name + $package_name = $plugin_zabbix_snmptrapd::params::package_name + $server_ip = hiera('management_vip') $plugin_settings = hiera('zabbix_snmptrapd') @@ -36,7 +38,7 @@ class plugin_zabbix_snmptrapd { group => 'root', mode => '0755', source => "puppet:///modules/plugin_zabbix_snmptrapd/initscripts/${service_name}", - require => Class['snmp'], + require => Package[$package_name], notify => Service[$service_name], } diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp index e62e53e..13c7bed 100644 --- a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp +++ b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/params.pp @@ -18,9 +18,11 @@ class plugin_zabbix_snmptrapd::params { case $::osfamily { 'Debian': { $service_name = 'snmpd' + $package_name = 'snmpd' } 'RedHat': { $service_name = 'snmptrapd' + $package_name = 'net-snmp' } default: { fail("unsuported osfamily ${::osfamily}, currently Debian and RedHat are the only supported platforms") diff --git a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/snmptt.pp b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/snmptt.pp index 0083fa6..f92d4a9 100644 --- a/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/snmptt.pp +++ b/deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/manifests/snmptt.pp @@ -27,9 +27,10 @@ class plugin_zabbix_snmptrapd::snmptt { } service { 'snmptt': - ensure => running, - enable => true, - require => Package['snmptt'], + ensure => running, + enable => true, + hasstatus => false, + require => Package['snmptt'], } file { '/etc/snmp/snmptt.ini': diff --git a/metadata.yaml b/metadata.yaml index 2a0704a..92c79d5 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -14,7 +14,7 @@ licenses: ['Apache License, Version 2.0'] # Homepage homepage: 'https://github.com/stackforge/fuel-plugin-zabbix-snmptrapd' # Authors -authors: ['Dmitry Klenov ', 'Piotr Misiak ', 'Szymon Banka ', 'Alexander Zatserklyany '] +authors: ['Dmitry Klenov ', 'Piotr Misiak ', 'Szymon Banka ', 'Bartosz Kupidura ', 'Alexander Zatserklyany '] # The plugin is compatible with releases in the list releases: