Skip to content

Commit

Permalink
pacemaker: remove node on delete (SOC-11240)
Browse files Browse the repository at this point in the history
On node delete, pacemaker needs to remove the node from the cluster
prior to being deleted from crowbar. This change adds said feature.
  • Loading branch information
sandonovsuse committed Aug 27, 2020
1 parent b75a61d commit 59b58f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crowbar_framework/app/models/crowbar_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,18 @@ def transition(inst, name, state)
xs <=> ys
end

# Make sure pacemaker is the first to execute on node delete
if state == "delete"
roles.each_with_index do |role, index|
rname = role.name.gsub(/-config-.*$/, "")
if rname == "pacemaker"
roles.delete_at(index)
roles.unshift(role)
break
end
end
end

roles.each do |role|
role.override_attributes.each do |bc, data|
rname = role.name.gsub("#{bc}-config-","")
Expand Down

0 comments on commit 59b58f0

Please sign in to comment.