Skip to content

Commit 2e60a22

Browse files
committed
pacemaker: remove node on delete (SOC-11240)
On node delete, pacemaker needs to remove the node from the cluster prior to being deleted from crowbar. This change adds said feature.
1 parent b75a61d commit 2e60a22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

crowbar_framework/app/models/crowbar_service.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ def transition(inst, name, state)
180180
xs <=> ys
181181
end
182182

183+
# Make sure pacemaker is the first to execute on node delete
184+
if state == "delete"
185+
# As nodes cannot be part of multiple Pacemaker proposals, there
186+
# should only be one occurence here
187+
index = roles.index { |role| role.name.include? "pacemaker-config-" }
188+
roles.unshift(roles.delete_at(index)) unless index.nil?
189+
end
190+
183191
roles.each do |role|
184192
role.override_attributes.each do |bc, data|
185193
rname = role.name.gsub("#{bc}-config-","")

0 commit comments

Comments
 (0)