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 newproperty(:enabled) do
16 desc 'Whether the tenant should be enabled. Defaults to true.'
17 newvalues(/(t|T)rue/, /(f|F)alse/, true, false )
20 value.to_s.downcase.to_sym
24 newproperty(:description) do
25 desc 'A description of the tenant.'
30 desc 'Read-only property of the tenant.'
32 raise(Puppet::Error, 'This is a read only property')
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
45 If no other credentials are present, the provider will search in
46 /etc/keystone/keystone.conf for an admin token and auth url.
48 Puppet::Util::Openstack.add_openstack_type_methods(self, auth_param_doc)