Uninstalling Puppet from Mac Os X

Recent on the StackExchange site Super User, the following question came up which seemed pretty straight forward.

How to uninstall puppet on Mac OS X ?

I naturally assumed that puppet labs would include an uninstaller with the .dmg package. It turns out, that is not the case. You must uninstall puppet manually.

Problem

I first identified where puppet was installed.

 which puppet 

/usr/bin/puppet

I assumed that there was also a puppet binary in the /usr/sbin directory which turned out to be correct

ls /usr/bin|grep puppet

puppet

Removing the puppet user was not as easy. I assumed it would be in /etc/shadow, however Mac does not use the shadow file. Nor does Mac have the userdel command.

wpid-screenshot2013-08-15at10-53-01am-2013-08-15-10-246.png

I discovered the following blog post which elaborates on the dscl command.

You will need to reboot the machine for the puppet user to be deleted.

To be thorough, I ran the following command to look for any additional puppet files

 sudo find / -iname 'puppet' -type d 

Sure enough, there are two other folders to delete

Solution

To uninstall puppet, delete the following files

/usr/bin/puppet
/usr/sbin/puppet

Remove the following directories
/private/etc/puppet
/usr/share/doc/puppet

To get rid of the puppet user that appears on the login screen
sudo dscl . delete /Users/puppet

Reboot the machine and puppet will be uninstalled.

Note that facter will still be present. Uninstalling facter is not in the scope of this post.

About spuder
spuder is a "super computer" support engineer by day, and tinkerer / hobbyist by night.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s