Remove hiera usage from the rabbit-fence service
This change moves the hiera usage from the rabbit-fence service to the cluster::rabbitmq_fence puppet class. Related-Bug: #1603182 Change-Id: I109487d2cd1d0eab19dd995959e1fcc68594a1bc Signed-off-by: Maksim Malchuk <mmalchuk@mirantis.com>
This commit is contained in:
parent
882b34bc6e
commit
8c341ac13e
@ -48,27 +48,38 @@ class cluster::rabbitmq_fence(
|
|||||||
package { $packages: } ->
|
package { $packages: } ->
|
||||||
|
|
||||||
service { $dbus_service_name:
|
service { $dbus_service_name:
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
} ->
|
} ->
|
||||||
|
|
||||||
service { 'corosync-notifyd':
|
service { 'corosync-notifyd':
|
||||||
ensure => running,
|
ensure => running,
|
||||||
enable => true,
|
enable => true,
|
||||||
} ->
|
} ->
|
||||||
|
|
||||||
package { 'fuel-rabbit-fence': } ->
|
package { 'fuel-rabbit-fence': } ->
|
||||||
|
|
||||||
|
file { '/etc/rabbitmq/node_name_prefix_for_messaging':
|
||||||
|
ensure => file,
|
||||||
|
mode => '0644',
|
||||||
|
content => hiera('node_name_prefix_for_messaging', 'messaging-'),
|
||||||
|
notify => Service['rabbit-fence'],
|
||||||
|
require => Package['fuel-rabbit-fence'],
|
||||||
|
} ->
|
||||||
|
|
||||||
service { 'rabbit-fence':
|
service { 'rabbit-fence':
|
||||||
|
ensure => $enabled ? {
|
||||||
|
true => running,
|
||||||
|
false => stopped },
|
||||||
name => $service_name,
|
name => $service_name,
|
||||||
enable => $enabled,
|
enable => $enabled,
|
||||||
ensure => $enabled ? { true => running, false => stopped },
|
|
||||||
require => Package['rabbitmq-server'],
|
require => Package['rabbitmq-server'],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $::osfamily == 'Debian' {
|
if $::osfamily == 'Debian' {
|
||||||
Exec {
|
Exec {
|
||||||
path => [ '/bin', '/usr/bin' ],
|
path => [ '/bin', '/usr/bin' ],
|
||||||
before => Service['corosync-notifyd'],
|
before => Service['corosync-notifyd'],
|
||||||
}
|
}
|
||||||
|
|
||||||
exec { 'enable_corosync_notifyd':
|
exec { 'enable_corosync_notifyd':
|
||||||
|
@ -49,7 +49,8 @@ def catchall_signal_lh(*args, **kwargs):
|
|||||||
node = args[0]
|
node = args[0]
|
||||||
this_node = socket.gethostname().split('.')[0]
|
this_node = socket.gethostname().split('.')[0]
|
||||||
node_name = node.split('.')[0]
|
node_name = node.split('.')[0]
|
||||||
node_name_prefix = bash_command('hiera node_name_prefix_for_messaging')
|
cmd = 'cat /etc/rabbitmq/node_name_prefix_for_messaging 2>/dev/null'
|
||||||
|
node_name_prefix = bash_command(cmd)
|
||||||
if node_name_prefix == 'nil' or node_name_prefix in node_name:
|
if node_name_prefix == 'nil' or node_name_prefix in node_name:
|
||||||
node_name_prefix = ''
|
node_name_prefix = ''
|
||||||
node_to_remove = 'rabbit@%s%s' % (node_name_prefix, node_name)
|
node_to_remove = 'rabbit@%s%s' % (node_name_prefix, node_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user