]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb
Revert "Add the posibility to tell openstack to use --os_cacert for keystone_tenant"
[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 require 'puppet/util/openstack'
4 Puppet::Type.newtype(:keystone_tenant) do
5
6   desc 'This type can be used to manage keystone tenants.'
7
8   ensurable
9
10   newparam(:name, :namevar => true) do
11     desc 'The name of the tenant.'
12     newvalues(/\w+/)
13   end
14
15   newproperty(:enabled) do
16     desc 'Whether the tenant should be enabled. Defaults to true.'
17     newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
18     defaultto(true)
19     munge do |value|
20       value.to_s.downcase.to_sym
21     end
22   end
23
24   newproperty(:description) do
25     desc 'A description of the tenant.'
26     defaultto('')
27   end
28
29   newproperty(:id) do
30     desc 'Read-only property of the tenant.'
31     validate do |v|
32       raise(Puppet::Error, 'This is a read only property')
33     end
34   end
35
36   # This ensures the service is started and therefore the keystone
37   # config is configured IF we need them for authentication.
38   # If there is no keystone config, authentication credentials
39   # need to come from another source.
40   autorequire(:service) do
41     ['keystone']
42   end
43
44   auth_param_doc=<<EOT
45 If no other credentials are present, the provider will search in
46 /etc/keystone/keystone.conf for an admin token and auth url.
47 EOT
48   Puppet::Util::Openstack.add_openstack_type_methods(self, auth_param_doc)
49 end