From 5e76dd1a08f04cb93731a1a052d8a321408f4c8c Mon Sep 17 00:00:00 2001 From: Nikita Koshikov Date: Fri, 22 May 2015 15:07:45 -0500 Subject: [PATCH] Added ability to specify role for corosync nodes. Partial blueprint: detach-components-from-controllers Change-Id: I887ad32bd6c9fcaabab5bd56d0825124b5b3e28f --- .../lib/puppet/parser/functions/corosync_nodes.rb | 3 ++- deployment/puppet/osnailyfacter/modular/cluster/cluster.pp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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':