diff --git a/attributes/default.rb b/attributes/default.rb index adbba1a..67cd573 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -46,6 +46,12 @@ default[:pacemaker][:stonith][:clone][:plugin] = "" default[:pacemaker][:stonith][:clone][:params] = {} default[:pacemaker][:stonith][:per_node][:plugin] = "" +# This can be "all" or "self": +# - if set to "all", then every node will configure the stonith resources for +# all nodes in the cluster +# - if set to "self", then every node will configure the stonith resource for +# itself only +default[:pacemaker][:stonith][:per_node][:mode] = "all" # This hash will contain parameters for each node. See documentation for # default[:pacemaker][:stonith][:clone][:params] about the format. # For instance: diff --git a/recipes/stonith.rb b/recipes/stonith.rb index ee372f5..af3c6f5 100644 --- a/recipes/stonith.rb +++ b/recipes/stonith.rb @@ -76,6 +76,10 @@ when "per_node" end node[:pacemaker][:stonith][:per_node][:nodes].keys.each do |node_name| + if node[:pacemaker][:stonith][:per_node][:mode] == "self" + next unless node_name == node[:hostname] + end + stonith_resource = "stonith-#{node_name}" params = node[:pacemaker][:stonith][:per_node][:nodes][node_name][:params]