Allow to run zabbix-server on every controller

Ensure apache configuration for frontend

Change-Id: I001602bce95c3aaa00991cb2b3337ec315a2731c
Closes-Bug: #1469131
This commit is contained in:
Bartosz Kupidura 2015-06-30 13:42:34 +00:00
parent 118b905ade
commit bc7d37abb2
6 changed files with 39 additions and 28 deletions

View File

@ -67,7 +67,8 @@ This is the first release of the plugin.
Contributors
------------
Dmitry Klenov <dklenov@mirantis.com> (PM)
Piotr Misiak <pmisiak@mirantis.com> (developer)
Szymon Bańka <sbanka@mirantis.com> (developer)
Alexander Zatserklyany <azatserklyany@mirantis.com> (QA engineer)
Dmitry Klenov <dklenov@mirantis.com> (PM)
Piotr Misiak <pmisiak@mirantis.com> (developer)
Szymon Bańka <sbanka@mirantis.com> (developer)
Bartosz Kupidura <bkupidura@mirantis.com> (developer)
Alexander Zatserklyany <azatserklyany@mirantis.com> (QA engineer)

View File

@ -66,8 +66,14 @@ class plugin_zabbix::controller {
enable => false,
require => File[$plugin_zabbix::params::server_config],
}
service { "${plugin_zabbix::params::server_service}-started":
ensure => running,
name => "p_${plugin_zabbix::params::server_service}",
enable => true,
provider => 'pacemaker',
}
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-init-stopped"]
File['zabbix-server-ocf'] -> Service["${plugin_zabbix::params::server_service}-init-stopped"] -> Service["${plugin_zabbix::params::server_service}-started"]
cron { 'zabbix db_clean':
ensure => 'present',
@ -77,6 +83,12 @@ class plugin_zabbix::controller {
minute => '*/5',
}
plugin_zabbix::db::mysql_db { $plugin_zabbix::params::db_name:
user => $plugin_zabbix::params::db_user,
password => $plugin_zabbix::params::db_password,
host => $plugin_zabbix::params::db_ip,
}
if $plugin_zabbix::params::frontend {
class { 'plugin_zabbix::frontend':
require => File[$plugin_zabbix::params::server_config],

View File

@ -56,17 +56,11 @@ class plugin_zabbix::db::mysql(
require => File['/tmp/zabbix/parts/data_clean.sql'],
}
plugin_zabbix::db::mysql_db { $plugin_zabbix::params::db_name:
user => $plugin_zabbix::params::db_user,
password => $db_password,
host => $db_ip,
require => Exec['prepare-schema-2'],
}
exec{ "${plugin_zabbix::params::db_name}-import":
command => "/usr/bin/mysql ${plugin_zabbix::params::db_name} < /tmp/zabbix/schema.sql && touch /tmp/zabbix/imported",
creates => '/tmp/zabbix/imported',
logoutput => true,
require => Database[$plugin_zabbix::params::db_name],
command => "/usr/bin/mysql ${plugin_zabbix::params::db_name} < /tmp/zabbix/schema.sql",
logoutput => true,
refreshonly => true,
subscribe => Database[$plugin_zabbix::params::db_name],
require => Exec['prepare-schema-2'],
}
}

View File

@ -67,13 +67,24 @@ class plugin_zabbix::frontend {
}
}
'Debian': {
file { '/etc/apache2/mods-enabled/worker.conf':
ensure => absent,
exec { 'disable-apache-worker':
command => 'a2dismod worker',
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'],
notify => Service[$plugin_zabbix::params::frontend_service],
require => Package[$plugin_zabbix::params::frontend_pkg],
}
file { '/etc/apache2/mods-enabled/worker.load':
ensure => absent,
exec { 'enable-apache-prefork':
command => 'a2enmod mpm_prefork',
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'],
notify => Service[$plugin_zabbix::params::frontend_service],
require => Package[$plugin_zabbix::params::frontend_pkg],
}
exec { 'enable-apache-php5':
command => 'a2enmod php5',
path => ['/usr/sbin', '/usr/bin', '/sbin', '/bin'],
notify => Service[$plugin_zabbix::params::frontend_service],
require => Package[$plugin_zabbix::params::frontend_pkg],
}

View File

@ -47,13 +47,6 @@ class plugin_zabbix::primary_controller {
],
}
service { "${plugin_zabbix::params::server_service}-started":
ensure => running,
name => "p_${plugin_zabbix::params::server_service}",
enable => true,
provider => 'pacemaker',
}
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}"]
Cs_resource["p_${plugin_zabbix::params::server_service}"] -> Cs_colocation['vip_management-with-zabbix-server']

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>', 'Alexander Zatserklyany <azatserklyany@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>']
# The plugin is compatible with releases in the list
releases: