Vincent Untz 071dd4970d Always remove deprecated target-role meta on update of a primitive
We deprecated setting target-role values via the meta attribute, in
favor of :start/:stop actions on the resource. So this should not be
relied upon anymore, and it's safe to drop this if we want to.

There is one racy case where this matters:
  - node1 and node2 try to create a primitive with the chef resource; on
    initial creation, we set target-role='Stopped' because we do not
    want to autostart primitives.
  - because they can't create it at the same time, node2 will fail on
    creation. If the chef resource is configured to retry, then node2
    will then try to update the primitive (since it now exists); but the
    chef resource is not reloaded so still has target-role='Stopped'.
  - if node1 had also started the primitive before node2 retries the
    :create, then the target-role will be changed from 'Started' to
    'Stopped' with the update.

This can result in a primitive not being started with [:create, :start].
Therefore, we just delete this deprecated bit from meta to avoid any issue.

[Thu, 31 Jul 2014 15:11:55 +0200] INFO: Processing pacemaker_primitive[vip-public-cluster-proposal-1] action create (crowbar-pacemaker::haproxy line 15)
[Thu, 31 Jul 2014 15:11:56 +0200] INFO: Creating new primitive resource 'vip-public-cluster-proposal-1'
[Thu, 31 Jul 2014 15:11:56 +0200] INFO: Processing execute[crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped" ] action run (/var/chef/cache/cookbooks/pacemaker/libraries/chef/mixin/pacemaker/sta
ndard_cib_object.rb line 91)

================================================================================
Error executing action `run` on resource 'execute[crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped" ]'
================================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped"  ----
STDOUT:
STDERR: ERROR: vip-public-cluster-proposal-1: id is already in use
---- End output of crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped"  ----
Ran crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped"  returned 1

[...]

[Thu, 31 Jul 2014 15:11:56 +0200] INFO: Retrying execution of pacemaker_primitive[vip-public-cluster-proposal-1], 0 attempt(s) left
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: Checking existing primitive resource 'vip-public-cluster-proposal-1' for modifications
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: vip-public-cluster-proposal-1's ip params didn't change
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: vip-public-cluster-proposal-1's target-role meta changed from  to Stopped
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: Processing execute[crm_resource --resource vip-public-cluster-proposal-1 --set-parameter "target-role" --parameter-value "Stopped" --meta] action run (/var/chef/cache/cookbooks/pacemaker/providers/primitive.rb line 88)
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: execute[crm_resource --resource vip-public-cluster-proposal-1 --set-parameter "target-role" --parameter-value "Stopped" --meta] ran successfully
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: Processing execute[crm configure primitive vip-public-cluster-proposal-1 ocf💓IPaddr2 params ip="192.168.126.5" meta target-role="Stopped" ] action nothing (/var/chef/cache/cookbooks/pacemaker/libraries/chef/mixin/pacemaker
/standard_cib_object.rb line 91)
[Thu, 31 Jul 2014 15:12:02 +0200] INFO: Processing execute[crm_resource --resource vip-public-cluster-proposal-1 --set-parameter "target-role" --parameter-value "Stopped" --meta] action nothing (/var/chef/cache/cookbooks/pacemaker/providers/primitive.rb line 88)
2014-08-01 17:50:48 +02:00
2014-04-04 11:51:42 +01:00
2014-06-19 15:05:12 +01:00
2014-03-06 08:36:35 +01:00
2014-03-29 11:47:59 +00:00

Build Status

DESCRIPTION

This is a cookbook for installing and configuring pacemaker.

Recipes

default

Installs and start pacemaker.

Resources/Providers

There are 7 LWRPs for interacting with pacemaker.

primitive

Configure and delete primitive resource.

  • :create configures a primitive
  • :delete deletes a primitive

Examples

pacemaker_primitive drbd do
  agent "ocf:linbit:drbd"
  params {'drbd_resource' => 'r0'}
  op {'monitor' => { 'interval' => '5s', 'role' => 'Master' } }
  action :create
end

clone

TBU

ms

TBU

location

TBU

colocation

TBU

order

TBU

node

TBU

License and Author

Author:: Robert Choi taeilchoi1@gmail.com

Copyright:: 2013 Robert Choi

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Description
RETIRED, Chef Cookbook - Pacemaker
Readme 318 KiB