diff --git a/lib/puppet/provider/keystone_puppet_config/ini_setting.rb b/lib/puppet/provider/keystone_puppet_config/ini_setting.rb deleted file mode 100644 index f3405bcc2..000000000 --- a/lib/puppet/provider/keystone_puppet_config/ini_setting.rb +++ /dev/null @@ -1,8 +0,0 @@ -Puppet::Type.type(:keystone_puppet_config).provide( - :ini_setting, - :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) -) do - def self.file_path - '/etc/keystone/puppet.conf' - end -end diff --git a/lib/puppet/type/keystone_puppet_config.rb b/lib/puppet/type/keystone_puppet_config.rb deleted file mode 100644 index b44a948b1..000000000 --- a/lib/puppet/type/keystone_puppet_config.rb +++ /dev/null @@ -1,14 +0,0 @@ -Puppet::Type.newtype(:keystone_puppet_config) do - require File.expand_path(File.join( - File.dirname(__FILE__), '..', '..', - 'puppet_x', 'keystone_config', 'ini_setting')) - extend PuppetX::KeystoneConfig::IniSetting - - desc 'Type for /etc/keystone/puppet.conf (DEPRECATED!!)' - - create_parameters - - autorequire(:file) do - ['/etc/keystone/puppet.conf'] - end -end diff --git a/manifests/deps.pp b/manifests/deps.pp index fe74381ec..0bbc2ae29 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -24,12 +24,6 @@ class keystone::deps { ~> Service<| tag == 'keystone-service' |> ~> anchor { 'keystone::service::end': } - # credential file for keystone api access should be generated during - # configuration phase - Anchor['keystone::config::begin'] - -> Keystone_puppet_config<||> - ~> Anchor['keystone::config::end'] - # On any uwsgi config change, we must restart Keystone. Anchor['keystone::config::begin'] -> Keystone_uwsgi_config<||> diff --git a/releasenotes/notes/remove-keystone_puppet_config-2eba1350a2d2fd85.yaml b/releasenotes/notes/remove-keystone_puppet_config-2eba1350a2d2fd85.yaml new file mode 100644 index 000000000..51044bd88 --- /dev/null +++ b/releasenotes/notes/remove-keystone_puppet_config-2eba1350a2d2fd85.yaml @@ -0,0 +1,4 @@ +--- +upgrade: + - | + The ``keystone_puppet_config`` resource type has been removed. diff --git a/spec/unit/provider/keystone_puppet_config/ini_setting_spec.rb b/spec/unit/provider/keystone_puppet_config/ini_setting_spec.rb deleted file mode 100644 index 82e4f39e9..000000000 --- a/spec/unit/provider/keystone_puppet_config/ini_setting_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'spec_helper' - -provider_class = Puppet::Type.type(:keystone_puppet_config).provider(:ini_setting) - -describe provider_class do - it 'should default to the default setting when no other one is specified' do - resource = Puppet::Type::Keystone_puppet_config.new( - {:name => 'DEFAULT/foo', :value => 'bar'} - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('DEFAULT') - expect(provider.setting).to eq('foo') - end - - it 'should allow setting to be set explicitly' do - resource = Puppet::Type::Keystone_puppet_config.new( - {:name => 'dude/foo', :value => 'bar'} - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('dude') - expect(provider.setting).to eq('foo') - end - - it 'should ensure absent when is specified as a value' do - resource = Puppet::Type::Keystone_puppet_config.new( - {:name => 'dude/foo', :value => ''} - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end - - it 'should ensure absent when value matches ensure_absent_val' do - resource = Puppet::Type::Keystone_puppet_config.new( - {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end -end diff --git a/spec/unit/type/keystone_puppet_config_spec.rb b/spec/unit/type/keystone_puppet_config_spec.rb deleted file mode 100644 index 5dfe702ae..000000000 --- a/spec/unit/type/keystone_puppet_config_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'spec_helper' -require 'puppet' -require 'puppet/type/keystone_puppet_config' - -describe 'Puppet::Type.type(:keystone_puppet_config)' do - before :each do - @keystone_puppet_config = Puppet::Type.type(:keystone_puppet_config).new(:name => 'DEFAULT/foo', :value => 'bar') - end - - it 'should require a name' do - expect { - Puppet::Type.type(:keystone_puppet_config).new({}) - }.to raise_error(Puppet::Error, 'Title or name must be provided') - end - - it 'should not expect a name with whitespace' do - expect { - Puppet::Type.type(:keystone_puppet_config).new(:name => 'f oo') - }.to raise_error(Puppet::Error, /Parameter name failed/) - end - - it 'should fail when there is no section' do - expect { - Puppet::Type.type(:keystone_puppet_config).new(:name => 'foo') - }.to raise_error(Puppet::Error, /Parameter name failed/) - end - - it 'should not require a value when ensure is absent' do - Puppet::Type.type(:keystone_puppet_config).new(:name => 'DEFAULT/foo', :ensure => :absent) - end - - it 'should accept a valid value' do - @keystone_puppet_config[:value] = 'bar' - expect(@keystone_puppet_config[:value]).to eq('bar') - end - - it 'should accept a value with whitespace' do - @keystone_puppet_config[:value] = 'b ar' - expect(@keystone_puppet_config[:value]).to eq('b ar') - end - - it 'should accept valid ensure values' do - @keystone_puppet_config[:ensure] = :present - expect(@keystone_puppet_config[:ensure]).to eq(:present) - @keystone_puppet_config[:ensure] = :absent - expect(@keystone_puppet_config[:ensure]).to eq(:absent) - end - - it 'should not accept invalid ensure values' do - expect { - @keystone_puppet_config[:ensure] = :latest - }.to raise_error(Puppet::Error, /Invalid value/) - end - - it 'should autorequire the config file' do - catalog = Puppet::Resource::Catalog.new - config_file = Puppet::Type.type(:file).new(:name => '/etc/keystone/puppet.conf') - catalog.add_resource config_file, @keystone_puppet_config - dependency = @keystone_puppet_config.autorequire - expect(dependency.size).to eq(1) - expect(dependency[0].target).to eq(@keystone_puppet_config) - expect(dependency[0].source).to eq(config_file) - end -end