IaC

Puppet Playground

Puppet is a model-driven configuration management tool that declares the desired state of your infrastructure using Puppet DSL..

Get access to the Puppet playground with one click

Welcome to the Puppet Playground!

Puppet 8 — the model-driven configuration management tool. Declare the desired state of your infrastructure in Puppet DSL; the agent converges the system to match.

What’s Pre-installed

  • Puppet Agent 8 from Puppetlabs official repo
  • PATH: /opt/puppetlabs/bin is pre-added
  • Shell: bash with vim, nano, git, curl, jq, sudo

Quick Start

puppet --version
puppet resource host localhost

Common Workflows

# Write and apply a manifest
cat > /tmp/demo.pp <<'EOF'
file { '/tmp/puppet-demo.txt':
  ensure  => present,
  content => "Hello from Puppet!\n",
  mode    => '0644',
}

exec { 'show-file':
  command => '/bin/cat /tmp/puppet-demo.txt',
  require => File['/tmp/puppet-demo.txt'],
}
EOF

sudo puppet apply /tmp/demo.pp
cat /tmp/puppet-demo.txt

Advanced Tips

# Define a class and module
mkdir -p /etc/puppetlabs/code/modules/mymodule/manifests
cat > /etc/puppetlabs/code/modules/mymodule/manifests/init.pp <<'EOF'
class mymodule {
  file { '/tmp/mymodule.txt':
    ensure  => present,
    content => "Module resource!\n",
  }
}
EOF

sudo puppet apply -e 'include mymodule'

# Inspect system resources
puppet resource package curl
puppet resource user codeground

# Check syntax
puppet parser validate /tmp/demo.pp

Session Notes

  • Session lasts 1 hour.
  • Masterless mode via puppet apply — no Puppet Server needed.
  • Use sudo puppet apply for manifests that modify system files.