diff --git a/definitions/pacemaker_vip_primitive.rb b/definitions/pacemaker_vip_primitive.rb index 89565b4..f2d3255 100644 --- a/definitions/pacemaker_vip_primitive.rb +++ b/definitions/pacemaker_vip_primitive.rb @@ -4,6 +4,8 @@ define :pacemaker_vip_primitive, :cb_network => nil, :hostname => nil, :domain = primitive_name = "#{params[:hostname]}-vip-#{params[:cb_network]}" + # Allow one retry, to avoid races where two nodes create the primitive at the + # same time when it wasn't created yet (only one can obviously succeed) pacemaker_primitive primitive_name do agent "ocf:heartbeat:IPaddr2" params ({ @@ -11,6 +13,8 @@ define :pacemaker_vip_primitive, :cb_network => nil, :hostname => nil, :domain = }) op params[:op] action :create + retries 1 + retry_delay 5 end # we return the primitive name so that the caller can use it as part of a