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
6 desc 'This type can be used to manage keystone tenants.'
10 newparam(:name, :namevar => true) do
11 desc 'The name of the tenant.'
15 newparam(:os_cacert) do
16 desc 'Parse os_cacert.'
19 newproperty(:enabled) do
20 desc 'Whether the tenant should be enabled. Defaults to true.'
21 newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
24 value.to_s.downcase.to_sym
28 newproperty(:description) do
29 desc 'A description of the tenant.'
34 desc 'Read-only property of the tenant.'
36 raise(Puppet::Error, 'This is a read only property')
40 # This ensures the service is started and therefore the keystone
41 # config is configured IF we need them for authentication.
42 # If there is no keystone config, authentication credentials
43 # need to come from another source.
44 autorequire(:service) do
49 If no other credentials are present, the provider will search in
50 /etc/keystone/keystone.conf for an admin token and auth url.
52 Puppet::Util::Openstack.add_openstack_type_methods(self, auth_param_doc)