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