X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_tenant.rb;h=449ccd04e36043374bbb21414f1d661e85fd59ae;hb=2dc39f2a756f82040d82cba324b21f44fad8ef3f;hp=f8aac517d7713ca7c6b3e17850bda8f4141eaa57;hpb=9323043aa25de76c23ba73489d575aecc7a8041d;p=dsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb index f8aac517..449ccd04 100644 --- a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb +++ b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb @@ -1,6 +1,8 @@ # LP#1408531 File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } -require 'puppet/util/openstack' +File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } +require 'puppet/provider/keystone/util' + Puppet::Type.newtype(:keystone_tenant) do desc 'This type can be used to manage keystone tenants.' @@ -12,10 +14,6 @@ Puppet::Type.newtype(:keystone_tenant) do newvalues(/\w+/) end - newparam(:os_cacert) do - desc 'Parse os_cacert.' - end - newproperty(:enabled) do desc 'Whether the tenant should be enabled. Defaults to true.' newvalues(/(t|T)rue/, /(f|F)alse/, true, false ) @@ -37,6 +35,20 @@ Puppet::Type.newtype(:keystone_tenant) do end end + newproperty(:domain) do + desc 'Domain for tenant.' + newvalues(nil, /\S+/) + def insync?(is) + raise(Puppet::Error, "The domain cannot be changed from #{self.should} to #{is}") unless self.should == is + true + end + end + + autorequire(:keystone_domain) do + # use the domain parameter if given, or the one from name if any + self[:domain] || Util.split_domain(self[:name])[1] + end + # This ensures the service is started and therefore the keystone # config is configured IF we need them for authentication. # If there is no keystone config, authentication credentials @@ -44,10 +56,4 @@ Puppet::Type.newtype(:keystone_tenant) do autorequire(:service) do ['keystone'] end - - auth_param_doc=<