Puppet Commands

May 16, 2020 · View on GitHub

FACTER

CommandDescription
factershow all facters
facter osfamilyshow OS Family facter
facter -yshow facters in YAML
facter -jshow facters in JSON
notify { "OS is ${::facts['operatingsystem']}": }use fact inside a manifest using 'facter' function
notify { "OS is $::operatingsystem": }use fact inside manifest directly
$::operatingsystemmajreleaseget OS major release from manifest

PUPPET AGENT

CommandDescription
puppet agent --test (or -t)Apply catalog using -verbose, -ignorecache, -no-daemonize -detailed-exit-codes, -show_diff
puppet agent -t --debugRun in debug mode with more output
puppet agent -t --noop Run simulation (no changes to system)
puppet agent -t --environment developmentRun catalog for different environment than whats configured in Puppet Agent's conf file
puppet agent --disableDisable puppet agent from running on node
puppet agent --enableEnable puppet agent to run on node
puppet resource packageshow all installed packages
puppet resource package apache ensure=present/absentinstall or remove package
puppet resourceshow all managed resources
puppet agent -t --graphshow a graph of all dependencies found in a catalog, stored in a .dot image

Mcollective

CommandDescription
sudo -i -u peadminRun MCollective as 'peadmin'
mco pingcheck connection to nodes
mco facts timezoneget nodes by Facter name
mco puppet countcheck how many MCO nodes are running
mco rpc service restart service=httpdrestart apache service
mco package status puppetcheck status of a package
mco inventory ––list-collectiveslist all subcollectives
mco puppet disable -I nodenamedisable puppet agent on node
mco ping -F architecture=x86_64find all nodes that are x64
mco find ––with-identity /nyc/find all nodes containing NYC in hostname
mco find ––with-class nginxfind all nodes with nginx class
mco puppet runall -F osfamily=Redhat 5kick off 'puppet agent -t' on your nodes
mco ping -T us_collectiverun command against a subcollective
mco service ntp start -I ny14.nycstart/stop service on a node
mco plugin docshow all available MCO plugins
mco rpc puppet last_run_summaryshow last run statistics for all nodes
/var/lib/peadmin/.mcollective.d/client.logmco client logs (on PE Master)

Modules

CommandDescription
puppet config print modulepathprint modulepath
puppet help modulemodules help
puppet module search 'nginx'search available modules: (PuppetForge)
puppet module install author/moduleinstall a module
puppet module generate author/modulebuild new module with full skeleton
puppet module listlist installed modules
puppet module list --treecheck for missing module dependencies
puppet module build author/modulebuild a module release package (.tar.gz)
puppet module changesshow modified files of an installed module

Puppet Server

CommandDescription
puppet cert list --allList all certs
puppet cert sign 'certname'sign certificate
puppet cert clean 'certname'remove client cert
puppet apply -e "class { 'my_super_module': version => '1.2'}"apply config directly from command line and pass parameter
/var/log/puppetlabs/puppetserver/puppetserver.logPuppet Server log
/var/log/puppetlabs/puppetdb/puppetdb.logPuppetDB log
/etc/puppetlabs/puppet/sslSSL certs location
/etc/puppetlabs/puppet/puppet.confMaster Configuration file
puppet config print allPrint all configuration settings