]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/lib/puppet/type/keystone_service.rb
try with modules from master
[dsa-puppet.git] / 3rdparty / modules / keystone / lib / puppet / type / keystone_service.rb
1 # LP#1408531
2 File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
3 File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
4
5 Puppet::Type.newtype(:keystone_service) do
6
7   desc 'This type can be used to manage keystone services.'
8
9   ensurable
10
11   newparam(:name, :namevar => true) do
12     desc 'The name of the service.'
13     newvalues(/\S+/)
14   end
15
16   newproperty(:id) do
17     validate do |v|
18       raise(Puppet::Error, 'This is a read only property')
19     end
20   end
21
22   newproperty(:type) do
23     desc 'The type of service'
24     validate do |value|
25       fail('The service type is required.') unless value
26     end
27   end
28
29   newproperty(:description) do
30     desc 'A description of the service.'
31     defaultto('')
32   end
33
34   # This ensures the service is started and therefore the keystone
35   # config is configured IF we need them for authentication.
36   # If there is no keystone config, authentication credentials
37   # need to come from another source.
38   autorequire(:service) do
39     ['keystone']
40   end
41 end