]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb
try with modules from master
[dsa-puppet.git] / 3rdparty / modules / keystone / lib / puppet / type / keystone_tenant.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_tenant) do
6
7   desc 'This type can be used to manage keystone tenants.'
8
9   ensurable
10
11   newparam(:name, :namevar => true) do
12     desc 'The name of the tenant.'
13     newvalues(/\w+/)
14   end
15
16   newproperty(:enabled) do
17     desc 'Whether the tenant should be enabled. Defaults to true.'
18     newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
19     defaultto(true)
20     munge do |value|
21       value.to_s.downcase.to_sym
22     end
23   end
24
25   newproperty(:description) do
26     desc 'A description of the tenant.'
27     defaultto('')
28   end
29
30   newproperty(:id) do
31     desc 'Read-only property of the tenant.'
32     validate do |v|
33       raise(Puppet::Error, 'This is a read only property')
34     end
35   end
36
37   # This ensures the service is started and therefore the keystone
38   # config is configured IF we need them for authentication.
39   # If there is no keystone config, authentication credentials
40   # need to come from another source.
41   autorequire(:service) do
42     ['keystone']
43   end
44 end