Uninstalling

Puppet Enterprise (PE) includes a script for uninstalling. You can uninstall infrastructure nodes or uninstall the agent from agent nodes.

Uninstall infrastructure nodes

The puppet-enterprise-uninstaller script is installed on the primary server. You must run the uninstaller script on each infrastructure node you want to uninstall.

By default, the uninstaller removes the software, users, logs, cron jobs, and caches. However, the uninstaller does not remove:
  • Modules
  • Manifests
  • Certificates
  • Databases
  • Configuration files
  • Home directories of any removed users
If you want to uninstall and reinstall a primary server on the same system, use the appropriate Uninstaller options to remove the otherwise untouched files and databases.
  1. On the infrastructure node that you want to uninstall, open the command line as root and navigate to the installer directory at /opt/puppetlabs/bin/puppet-enterprise-uninstaller
  2. Run the uninstall command: sudo ./puppet-enterprise-uninstaller
  3. Follow the prompts to complete the uninstallation.
  4. Remove the infrastructure node's certificate from the Puppet infrastructure configuration by running the following command on the primary server:
    puppet node purge <PE_COMPONENT_CERT_NAME>

Uninstall agents

You can remove the puppet-agent package from nodes that you no longer want Puppet Enterprise (PE) to manage.

Important: Uninstalling the agent doesn't remove the node from your inventory or free up the node's license to use on another node. To remove a node, you must purge the node.

Uninstall *nix agents

The *nix agent package includes an uninstall script you can use to remove the agent from the node.

  1. On the agent node, run the uninstall script: /opt/puppetlabs/bin/puppet-enterprise-uninstaller
  2. Follow the prompts to complete the uninstallation.
  3. Optional: If you want to reinstall the agent on the node later, make sure you remove the node's agent certificate from the primary server. To do this, on the primary server run: puppetserver ca clean --certname <AGENT_CERT_NAME>
What to do next
If you want to remove the node from your inventory and use the node's license on another node, you must purge the node, as explained in Remove agent nodes.

Uninstall Windows agents

To uninstall the agent from a Windows node, use the Windows Add or Remove Programs interface or the command line.

Uninstalling the agent from a Windows node removes the Puppet program directory, the agent service, and all related registry keys. The data directory remains intact, including all SSL keys. To completely remove the Puppet agent from the system, you must also manually delete the data directory.
  1. Uninstall the agent:
    • Use the Windows Add or Remove Programs interface.
    • Use the command line if you have the original .msi file or know the installed MSI's product code. For example: msiexec /qn /norestart /x [puppet.msi|<PRODUCT_CODE>]
  2. Optional: If you want to reinstall the agent on the node later, make sure you remove the node's agent certificate from the primary server. To do this, on the primary server run: puppetserver ca clean --certname <AGENT_CERT_NAME>
What to do next
If you want to remove the node from your inventory and use the node's license on another node, you must purge the node, as explained in Remove agent nodes.

Uninstall macOS agents

Use the command line to remove the agent from macOS nodes.

  1. On the agent node, run these commands:
    rm -rf /var/log/puppetlabs
    rm -rf /var/run/puppetlabs
    pkgutil --forget com.puppetlabs.puppet-agent
    launchctl remove puppet
    rm -rf /Library/LaunchDaemons/com.puppetlabs.puppet.plist  
    launchctl remove pxp-agent  
    rm -rf /Library/LaunchDaemons/com.puppetlabs.pxp-agent.plist
    rm -rf /etc/puppetlabs
    rm -rf /opt/puppetlabs
  2. Optional: If you want to reinstall the agent on the node later, make sure you remove the node's agent certificate from the primary server. To do this, on the primary server run: puppetserver ca clean --certname <AGENT_CERT_NAME>
What to do next
If you want to remove the node from your inventory and use the node's license on another node, you must purge the node, as explained in Remove agent nodes.

Uninstaller options

You can use these command line options to change the uninstaller's behavior.

  • -p: Purge additional files. In addition to the software, users, logs, cron jobs, and caches, the uninstaller also removes all configuration files, modules, manifests, certificates, the home directories of any users created by the installer, and the Puppet public GPG key used for package verification.
  • -d: Remove any databases created during installation.
  • -h: Display a help message.
  • -n: Run in noop mode and show commands that would have run during uninstallation without actually running them.
  • -y: Don't ask to confirm uninstallation. Assuming the answer is yes.
To remove every trace of PE from a system, which is required if you want to reinstall PE on the same system, run this command:
sudo ./puppet-enterprise-uninstaller -d -p

For Windows systems, open an administrator command prompt and run the command without sudo.