Install OCF script before any Pacemaker configuration

Change-Id: Ie5db7bf8f70368baed2ba5f0097ba404ce1a3cec
Closes-bug: #1608852
This commit is contained in:
Swann Croiset 2016-08-02 12:54:24 +02:00
parent 2bed5dbe6e
commit 4a72ee8edb
1 changed files with 22 additions and 0 deletions

View File

@ -29,3 +29,25 @@ case $::osfamily {
# Currently only Debian like distributions need specific configuration. # Currently only Debian like distributions need specific configuration.
} }
} }
$fuel_version = 0 + hiera('fuel_version')
if $fuel_version < 8.0 {
$cur_node_roles = node_roles(hiera_array('nodes'), hiera('uid'))
$is_controller = member($cur_node_roles, 'controller') or
member($cur_node_roles, 'primary-controller')
} else {
$is_controller = roles_include(['controller', 'primary-controller'])
}
if $is_controller {
# The OCF script should exist before any node tries to configure the
# Zabbix with Pacemaker. This is why it is shipped by this manifest.
file { 'zabbix-server-ocf' :
ensure => present,
path => '/usr/lib/ocf/resource.d/fuel/zabbix-server',
mode => '0755',
owner => 'root',
group => 'root',
source => 'puppet:///modules/plugin_zabbix/zabbix-server.ocf',
}
}