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 2e60a22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,14 @@ def transition(inst, name, state)
xs <=> ys
end

# Make sure pacemaker is the first to execute on node delete
if state == "delete"
# As nodes cannot be part of multiple Pacemaker proposals, there
# should only be one occurence here
index = roles.index { |role| role.name.include? "pacemaker-config-" }
roles.unshift(roles.delete_at(index)) unless index.nil?
end

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

0 comments on commit 2e60a22

Please sign in to comment.