Service "zabbix_server" was restarted after executing of task "upload_core_repos"

Closes-Bug: #1529642

New version complying with latest code review comments
Note that for latest comment (line 75 of controller.pp), I had tried and it did not work

Change-Id: I325c7ff6f5954b81325db832f9e88b125a376874
This commit is contained in:
Olivier Bourdon 2016-01-08 16:32:52 +01:00
parent 51536fb375
commit 0662050eee
6 changed files with 55 additions and 9 deletions

View File

@ -73,3 +73,4 @@ Bartosz Kupidura <bkupidura@mirantis.com> (developer)
Alexander Zatserklyany <azatserklyany@mirantis.com> (QA engineer)
Maciej Relewicz <mrelewicz@mirantis.com> (developer)
Swann Croiset <scroiset@mirantis.com> (developer)
Olivier Bourdon <obourdon@mirantis.com> (developer)

View File

@ -0,0 +1,28 @@
#
# 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.
#
# check_zabbix_pacemaker.rb
Facter.add('check_zabbix_pacemaker') do
setcode do
crm_cmd = Facter::Util::Resolution.exec('/bin/which crm')
if crm_cmd.nil? then
''
else
crm_res = Facter::Util::Resolution.exec(crm_cmd + ' status | grep zabbix' )
end
end
end

View File

@ -15,6 +15,8 @@
#
class plugin_zabbix::controller {
$zabbix_pcmk_managed = $::check_zabbix_pacemaker
include plugin_zabbix::params
$host = regsubst($plugin_zabbix::params::db_ip,'^(\d+\.\d+\.\d+\.)\d+','\1%')
@ -51,11 +53,13 @@ class plugin_zabbix::controller {
group => 'root',
source => 'puppet:///modules/plugin_zabbix/zabbix-server.ocf',
}
service { "${plugin_zabbix::params::server_service}-init-stopped":
ensure => 'stopped',
name => $plugin_zabbix::params::server_service,
enable => false,
require => File[$plugin_zabbix::params::server_config],
if $zabbix_pcmk_managed == '' {
service { "${plugin_zabbix::params::server_service}-init-stopped":
ensure => 'stopped',
name => $plugin_zabbix::params::server_service,
enable => false,
require => File[$plugin_zabbix::params::server_config],
}
}
service { "${plugin_zabbix::params::server_service}-started":
ensure => running,
@ -64,8 +68,11 @@ class plugin_zabbix::controller {
provider => 'pacemaker',
}
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Service["${plugin_zabbix::params::server_service}-started"]
if $zabbix_pcmk_managed == '' {
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Service["${plugin_zabbix::params::server_service}-started"]
} else {
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-started"]
}
sysctl::value { 'kernel.shmmax':
value => $plugin_zabbix::params::sysctl_kernel_shmmax,
notify => Service["${plugin_zabbix::params::server_service}-started"],

View File

@ -59,6 +59,8 @@ class plugin_zabbix::primary_controller {
}
File[$plugin_zabbix::params::server_config] -> File['zabbix-server-ocf'] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
if $plugin_zabbix::controller::zabbix_pcmk_managed == '' {
Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Cs_resource["p_${plugin_zabbix::params::server_service}"]
}
Cs_rsc_colocation['vip-with-zabbix'] -> Service["${plugin_zabbix::params::server_service}-started"]
}

View File

@ -21,6 +21,10 @@ Release Notes
**2.5.0**
* Service "zabbix_server" was restarted after executing of task "upload_core_repos" (bug 1529642_)
* Monitoring of HAProxy vips doesn't work when the backend name contains dots (bug 1525713_)
* Zabbix plugin should provide zabbix_get command (bug 1525924_)
* fail to deploy with base-os or virt roles (bug 1515956_)
* Enhance :ref:`Ceph` monitoring
* :ref:`tuning` for server and agents
* Add :ref:`MySQL` cluster metrics (wsrep global variables)
@ -43,6 +47,10 @@ Release Notes
* Allow deployment without Horizon (bug 1517005_)
* Skip zabbix agent installation when node has either 'base-os' or 'virt' role (bug 1515956_)
.. _1529642: https://bugs.launchpad.net/fuel-plugins/+bug/1529642
.. _1525713: https://bugs.launchpad.net/fuel-plugins/+bug/1525713
.. _1525924: https://bugs.launchpad.net/fuel-plugins/+bug/1525924
.. _1515956: https://bugs.launchpad.net/fuel-plugins/+bug/1515956
.. _1483983: https://bugs.launchpad.net/fuel/7.0.x/+bug/1483983
.. _1510115: https://bugs.launchpad.net/fuel/+bug/1510115
.. _1513454: https://bugs.launchpad.net/fuel-plugins/+bug/1513454

View File

@ -14,7 +14,7 @@ licenses: ['Apache License, Version 2.0']
# Homepage
homepage: 'https://github.com/stackforge/fuel-plugin-external-zabbix'
# Authors
authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@mirantis.com>', 'Szymon Banka <sbanka@mirantis.com>', 'Bartosz Kupidura <bkupidura@mirantis.com>', 'Alexander Zatserklyany <azatserklyany@mirantis.com>', 'Swann Croiset <scroiset@mirantis.com>']
authors: ['Dmitry Klenov <dklenov@mirantis.com>', 'Piotr Misiak <pmisiak@mirantis.com>', 'Szymon Banka <sbanka@mirantis.com>', 'Bartosz Kupidura <bkupidura@mirantis.com>', 'Alexander Zatserklyany <azatserklyany@mirantis.com>', 'Swann Croiset <scroiset@mirantis.com>', 'Olivier Bourdon <obourdon@mirantis.com>']
# The plugin is compatible with releases in the list
releases: