Puppet

Puppet Cheatsheet #

Puppet is an open-source configuration management tool that allows you to define the state of your IT infrastructure using a declarative language. Puppet automates the process of managing infrastructure, including software installation, configuration management, and more.

Puppet Basics #

Command/OptionExampleDescription
puppet –versionpuppet --versionDisplay the version of Puppet installed
puppet applypuppet apply manifest.ppApply a Puppet manifest locally
puppet agent -tpuppet agent -tRun the Puppet agent manually on the node

Puppet Agent #

Command/OptionExampleDescription
puppet agent –enablepuppet agent --enableEnable the Puppet agent
puppet agent –disablepuppet agent --disableDisable the Puppet agent
puppet agent –testpuppet agent --testRun the Puppet agent in test mode

Puppet Server Management #

Command/OptionExampleDescription
puppetserver startpuppetserver startStart the Puppet server
puppetserver stoppuppetserver stopStop the Puppet server
puppetserver reloadpuppetserver reloadReload the Puppet server configuration
puppetserver ca listpuppetserver ca list --allList all certificate signing requests

Puppet Modules #

Command/OptionExampleDescription
puppet module generatepuppet module generate username-modulenameGenerate a new module skeleton
puppet module installpuppet module install puppetlabs-apacheInstall a module from the Puppet Forge
puppet module listpuppet module listList all installed modules
puppet module uninstallpuppet module uninstall puppetlabs-apacheUninstall a module

Puppet Resource #

Command/OptionExampleDescription
puppet resource userpuppet resource userDisplay the current state of user resources
puppet resource servicepuppet resource serviceDisplay the current state of service resources
puppet resource packagepuppet resource packageDisplay the current state of package resources

Hiera #

Command/OptionExampleDescription
hiera lookuphiera lookup keyLookup data in Hiera
hiera confighiera configDisplay the current Hiera configuration

Fact Management #

Command/OptionExampleDescription
facterfacterDisplay all facts about the system
facterfacter osDisplay a specific fact about the system

PuppetDB #

Command/OptionExampleDescription
puppet querypuppet query 'nodes { certname ~ "web" }'Query the PuppetDB
puppet facts findpuppet facts find <node>Retrieve facts for a specific node

Puppet CA Management #

Command/OptionExampleDescription
puppet cert listpuppet cert listList all certificate requests
puppet cert signpuppet cert sign <hostname>Sign a certificate request
puppet cert revokepuppet cert revoke <hostname>Revoke a certificate

This cheatsheet covers the most commonly used Puppet commands and options, helping you to manage agents, servers, modules, resources, facts, PuppetDB, and certificate authorities effectively.

Puppet

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.