-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add yum::repo ensure => absent functionality #22
Add yum::repo ensure => absent functionality #22
Conversation
Without this patch puppet-lint 2.3.1 results in this error in Ruby 1.8.7: SyntaxError: /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint/configuration.rb:53: undefined (?...) sequence: /^(?<option>\w+)=?$/ /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:7:in `gem_original_require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:7:in `require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint.rb:7 /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint/tasks/puppet-lint.rb:1:in `gem_original_require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint/tasks/puppet-lint.rb:1:in `require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppet-lint-2.3.1/lib/puppet-lint/tasks/puppet-lint.rb:1 /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppetlabs_spec_helper-2.0.2/lib/puppetlabs_spec_helper/rake_tasks.rb:438:in `gem_original_require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppetlabs_spec_helper-2.0.2/lib/puppetlabs_spec_helper/rake_tasks.rb:438:in `require' /home/travis/.rvm/gems/ruby-1.8.7-p371/gems/puppetlabs_spec_helper-2.0.2/lib/puppetlabs_spec_helper/rake_tasks.rb:438 /home/travis/build/nytm/puppet-module-confluence/Rakefile:1:in `gem_original_require' /home/travis/build/nytm/puppet-module-confluence/Rakefile:1:in `require' /home/travis/build/nytm/puppet-module-confluence/Rakefile:1 /home/travis/.rvm/gems/ruby-1.8.7-p371/bin/ruby_executable_hooks:15 (See full trace by running task with --trace) The issue has been filed upstream as rodjek/puppet-lint#759
59aac67
to
be3335b
Compare
@@ -155,7 +164,6 @@ | |||
|
|||
# Only need to deal with importing GPG keys, if we have gpgcheck enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a conditional around the existing conditional and code for yum::rpm_gpg_key
if $ensure == 'present' {
<existing code>
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added ensure == 'present' condition.
@@ -232,6 +232,16 @@ | |||
it { should contain_file('rspec.repo').with_content(/\[rspec\][\s\S]*sslcacert=\/path\/to\/cert/) } | |||
end | |||
|
|||
context 'with ensure set to valid string "absent"' do | |||
let(:params) { mandatory_params.merge({ :ensure => 'absent' }) } | |||
it { should contain_file('rspec.repo').with_ensure('absent') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it { is_expected.to have_yum__rpm_gpg_key_resource_count(0) }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, added the test.
Without this patch, puppet cannot easily remove specific yum repositories. This is a problem in situations where the directory cannot be fully purged due to unmanaged files and when a specific configuration needs to be removed from specific nodes.
be3335b
to
8928ba7
Compare
@ghoneycutt Requested changes have been made. |
Released in v1.4.0 |
Without this patch, puppet cannot easily remove specific yum
repositories. This is a problem in situations where the
directory cannot be fully purged due to unmanaged files and
when a specific configuration needs to be removed from specific
nodes.