Merge "Added ability to specify role for corosync nodes."
This commit is contained in:
commit
30cac2d68e
@ -5,6 +5,7 @@ to be used in pcmk_nodes resource.
|
||||
EOS
|
||||
) do |args|
|
||||
nodes = args[0]
|
||||
roles = args[1] || %w(primary-controller controller)
|
||||
fail "You should provided 'nodes' structure!" unless nodes.is_a? Array and nodes.any?
|
||||
corosync_nodes = {}
|
||||
nodes.each do |node|
|
||||
@ -12,7 +13,7 @@ to be used in pcmk_nodes resource.
|
||||
ip = node['internal_address']
|
||||
uid = node['uid']
|
||||
role = node['role']
|
||||
next unless %w(primary-controller controller).include? role
|
||||
next unless roles.include? role
|
||||
next unless ip and fqdn
|
||||
corosync_nodes[fqdn] = {
|
||||
'id' => uid,
|
||||
|
@ -1,7 +1,8 @@
|
||||
notice('MODULAR: cluster.pp')
|
||||
|
||||
$nodes = hiera('nodes')
|
||||
$corosync_nodes = corosync_nodes($nodes)
|
||||
$corosync_roles = hiera('corosync_roles',['primary-controller', 'controller'])
|
||||
$corosync_nodes = corosync_nodes($nodes,$corosync_roles)
|
||||
$internal_address = hiera('internal_address')
|
||||
|
||||
class { 'cluster':
|
||||
|
Loading…
Reference in New Issue
Block a user