X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_tenant.rb;fp=3rdparty%2Fmodules%2Fkeystone%2Flib%2Fpuppet%2Ftype%2Fkeystone_tenant.rb;h=0000000000000000000000000000000000000000;hb=6e1426dc77fb4e5d51f07c187c6f2219431dc31e;hp=449ccd04e36043374bbb21414f1d661e85fd59ae;hpb=87423ba664cd5f2bb462ebadd08b1a90d0fe1c8d;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb b/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb deleted file mode 100644 index 449ccd04e..000000000 --- a/3rdparty/modules/keystone/lib/puppet/type/keystone_tenant.rb +++ /dev/null @@ -1,59 +0,0 @@ -# LP#1408531 -File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) } -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.' - - ensurable - - newparam(:name, :namevar => true) do - desc 'The name of the tenant.' - newvalues(/\w+/) - end - - newproperty(:enabled) do - desc 'Whether the tenant should be enabled. Defaults to true.' - newvalues(/(t|T)rue/, /(f|F)alse/, true, false ) - defaultto(true) - munge do |value| - value.to_s.downcase.to_sym - end - end - - newproperty(:description) do - desc 'A description of the tenant.' - defaultto('') - end - - newproperty(:id) do - desc 'Read-only property of the tenant.' - validate do |v| - raise(Puppet::Error, 'This is a read only property') - 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 - # need to come from another source. - autorequire(:service) do - ['keystone'] - end -end