I’ve been scratching my head trying to figure out why the Puppet agent on a node stopped functioning with an odd error the implies that provider detection had gone arry.
Error: Failed to apply catalog: Parameter ensure failed on File[/root/.ssh/id_rsa]: Provider must have features 'manages_symlinks' to set 'ensure' to 'link' at /etc/puppet/env/production/modules/sdm/manifests/users/mss.pp:55 Wrapped exception: Provider must have features 'manages_symlinks' to set 'ensure' to 'link'
After chasing internal puppet issues and even network problems I finally found this post to the puppet-users group. Sure enough, a bunch of local gems had been installed — almost certainly by me testing a module in
--noop mode on a host I shouldn’t have been testing on.
# gem list *** LOCAL GEMS *** builder (3.2.2) bundler (1.3.5) diff-lcs (1.2.4) facter (1.7.3) hiera (1.2.1) highline (1.6.19) json (1.4.6) json_pure (1.8.0) kwalify (0.7.2) metaclass (0.0.1) mocha (0.14.0) net-scp (1.1.2) net-ssh (2.7.0) nokogiri (1.5.10) puppet (3.3.0) puppet-lint (0.3.2) puppet-syntax (1.1.0) puppetlabs_spec_helper (0.4.1) rake (10.1.0) rbvmomi (1.6.0) rgen (0.6.6) rspec (2.14.1) rspec-core (2.14.5) rspec-expectations (2.14.3) rspec-mocks (2.14.3) rspec-puppet (0.1.6) rspec-system (2.3.0) rspec-system-puppet (2.2.0) rspec-system-serverspec (1.0.0) serverspec (0.6.3) stomp (1.2.2) systemu (2.5.2) trollop (2.0)
The good news is that this is easy to fix with my recipe for how to remove all Ruby Gems except those installed by system packages.