Get access to the Chef playground with one click
Welcome to the Chef Playground!
Chef Infra — the Ruby-based infrastructure automation platform. Write recipes and cookbooks to define your infrastructure as code, then converge any node to that desired state.
Tip: Use
chef-solo for local convergence (no Chef Server required). Run chef-solo --version to confirm it’s ready.What’s Pre-installed
- Chef Infra Client (latest via omnitruck) with
chef-solo,chef-client,ohai,knife - Shell: bash with vim, nano, git, curl, jq, sudo
Quick Start
chef-solo --version ohai | head -20 # system inventory in JSON chef-client --version
Common Workflows
# Write and run a recipe
mkdir -p /tmp/chef-demo/cookbooks/myapp/recipes
cat > /tmp/chef-demo/cookbooks/myapp/recipes/default.rb <<'EOF'
file '/tmp/chef-test.txt' do
content "Hello from Chef!\n"
mode '0644'
end
execute 'show file' do
command 'cat /tmp/chef-test.txt'
end
EOF
cat > /tmp/chef-demo/solo.rb <<'EOF'
cookbook_path ['/tmp/chef-demo/cookbooks']
EOF
cat > /tmp/chef-demo/dna.json <<'EOF'
{"run_list":["recipe[myapp]"]}
EOF
chef-solo -c /tmp/chef-demo/solo.rb -j /tmp/chef-demo/dna.jsonAdvanced Tips
# Generate a cookbook with ChefDK conventions chef generate cookbook /tmp/mycookbook ls /tmp/mycookbook/ # Ohai node attributes ohai | python3 -m json.tool | grep -A2 '"platform"' # Knife commands (local mode) knife node list --local-mode knife cookbook list --local-mode
Session Notes
- Session lasts 1 hour.
- Uses
chef-solomode — no Chef Server or internet access required. - You have
sudoaccess ascodegroundfor system-level operations.