Files
cookbook-pacemaker/spec/fixtures/keystone_primitive.rb
Adam Spiers fdebd24117 newly created resources should not be started
In Pacemaker, target-role defaults to 'Started', but we want to allow
consumers of the LWRPs the choice whether their newly created resource
gets started or not, and we also want to adhere to the Principle of
Least Surprise.  Therefore we stick to the intuitive semantics that

  action :create

creates the resource with target-role="Stopped" in order to prevent it
from starting immediately, whereas

  action [:create, :start]

creates the resource and then starts it.

Since we are honouring :start / :stop actions to determine the
target-role value, if target-role is specified via meta, it will just be
overridden anyway.  So we also deprecate direct use of target-role meta
parameter in recipes.
2014-04-10 23:53:20 +01:00

32 lines
1.2 KiB
Ruby

require ::File.expand_path('../../libraries/pacemaker/resource/primitive',
File.dirname(__FILE__))
module Chef::RSpec
module Pacemaker
module Config
KEYSTONE_PRIMITIVE = ::Pacemaker::Resource::Primitive.new('keystone')
KEYSTONE_PRIMITIVE.agent = "ocf:openstack:keystone"
KEYSTONE_PRIMITIVE.params = [
[ "os_password", "adminpw" ],
[ "os_auth_url", "http://node1:5000/v2.0" ],
[ "os_username", "admin" ],
[ "os_tenant_name", "openstack" ],
[ "user", "openstack-keystone" ],
]
KEYSTONE_PRIMITIVE.meta = [
[ "is-managed", "true" ]
]
KEYSTONE_PRIMITIVE.op = [
[ "monitor", { "timeout" => "60", "interval" => "10s" } ],
[ "start", { "timeout" => "240", "interval" => "10s" } ]
]
KEYSTONE_PRIMITIVE_DEFINITION = <<'EOF'.chomp
primitive keystone ocf:openstack:keystone \
params os_auth_url="http://node1:5000/v2.0" os_password="adminpw" os_tenant_name="openstack" os_username="admin" user="openstack-keystone" \
meta is-managed="true" \
op monitor interval="10s" timeout="60" op start interval="10s" timeout="240"
EOF
end
end
end