]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/lib/puppet/type/keystone_domain.rb
Update to Kilo
[dsa-puppet.git] / 3rdparty / modules / keystone / lib / puppet / type / keystone_domain.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_domain) do
6
7   desc <<-EOT
8     This type can be used to manage
9     keystone domains.
10   EOT
11
12   ensurable
13
14   newparam(:name, :namevar => true) do
15     newvalues(/\w+/)
16   end
17
18   newproperty(:enabled) do
19     newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
20     defaultto(true)
21     munge do |value|
22       value.to_s.downcase.to_sym
23     end
24   end
25
26   newproperty(:description)
27
28   newproperty(:is_default) do
29     desc <<-EOT
30       If this is true, this is the default domain used for v2.0 requests when the domain
31       is not specified, or used by v3 providers if no other domain is specified.  The id
32       of this domain will be written to the keystone config identity/default_domain_id
33       value.
34     EOT
35     newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
36     defaultto(false)
37     munge do |value|
38       value.to_s.downcase.to_sym
39     end
40   end
41
42   newproperty(:id) do
43     validate do |v|
44       raise(Puppet::Error, 'This is a read only property')
45     end
46   end
47
48   # we should not do anything until the keystone service is started
49   autorequire(:service) do
50     'keystone'
51   end
52
53
54 end