diff --git a/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/corosync_nodes.rb b/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/corosync_nodes.rb index 978b30ad6d..3415dc988a 100644 --- a/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/corosync_nodes.rb +++ b/deployment/puppet/osnailyfacter/lib/puppet/parser/functions/corosync_nodes.rb @@ -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, diff --git a/deployment/puppet/osnailyfacter/modular/cluster/cluster.pp b/deployment/puppet/osnailyfacter/modular/cluster/cluster.pp index bbc7592217..55cb310a3f 100644 --- a/deployment/puppet/osnailyfacter/modular/cluster/cluster.pp +++ b/deployment/puppet/osnailyfacter/modular/cluster/cluster.pp @@ -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':