Cleaning a host entry from MySQL DB with puppet 2.7.11-2

Yesterday I’ve had to clean up a host from the storeconfig mysql database. I ran the puppetstoredconfigclean.rb script and bumped into the following documented Bug http://projects.puppetlabs.com/issues/12405 which will be fixed in version 2.7.12:

# ./puppetstoredconfigclean.rb  kvm0.domb.net

###################################################################

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in

gem_original_require': no such file to load -- sqlite3 (MissingSourceFile)
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in

require’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in

require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:355:in

new_constants_in’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/dependencies.rb:510:in

require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/kernel/requires.rb:7:in

require_library_or_gem’
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/kernel/reporting.rb:11:in

silence_warnings'
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.1.1/lib/active_support/core_ext/kernel/requires.rb:5:in

require_library_or_gem’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:10:in

sqlite3_connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in

send’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:292:in

connection='
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:260:in

retrieve_connection’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in

connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1149:in

columns’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1162:in

column_names'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1175:in

column_methods_hash’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1719:in

all_attributes_exists?'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in

all?’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1719:in

each'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1719:in

all?’
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1719:in

all_attributes_exists?'
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.1.1/lib/active_record/base.rb:1618:in

method_missing’
from ./puppetstoredconfigclean.rb:93
from ./puppetstoredconfigclean.rb:92:in `each’
from ./puppetstoredconfigclean.rb:92

###################################################################

If you want to fix the puppetstoredconfigclean.rb script in 2.7.11-2 apply “Frederik Wagner” patch.

http://projects.puppetlabs.com/attachments/1781/0001-puppet-settings-have-to-be-parsed.patch

Thanks to “Frederik Wagner” for saving me a lot of time 🙂

 

 

 

2 thoughts on “Cleaning a host entry from MySQL DB with puppet 2.7.11-2

    • I like puppetstoreconfigclean because I have the ability to clean false entries in the db affecting my nagios configs without deleting the host. “Puppet clean node” seems to be perfect for removing hosts completely from puppet. Thanks for that one. Hopp Schwiiz 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

*


Hit Counter provided by laptop reviews