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) }
5 Puppet::Type.newtype(:keystone_tenant) do
7 desc 'This type can be used to manage keystone tenants.'
11 newparam(:name, :namevar => true) do
12 desc 'The name of the tenant.'
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 )
21 value.to_s.downcase.to_sym
25 newproperty(:description) do
26 desc 'A description of the tenant.'
31 desc 'Read-only property of the tenant.'
33 raise(Puppet::Error, 'This is a read only property')
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