← 返回命令列表

Linux command

puppet 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Apply manifest locally

puppet apply [manifest.pp]

Check manifest syntax

puppet parser validate [manifest.pp]

Run puppet agent in test mode

puppet agent --test

Run puppet agent in dry-run mode

puppet agent --test --noop

List available modules

puppet module list

Install a module from Puppet Forge

puppet module install [author-module]

Inspect a resource on the system

puppet resource [user] [root]

View or set a configuration value

puppet config print [server]

说明

puppet is a configuration management tool that automates the provisioning and management of infrastructure using a declarative language. Administrators describe the desired state of systems through manifests written in Puppet's DSL, and the tool ensures machines converge to that state by installing packages, managing files, configuring services, and handling users. Puppet operates in two modes: a client-server architecture where agents pull catalogs from a Puppet server, and a standalone mode using puppet apply for local manifest execution. The resource abstraction layer handles platform differences automatically, so the same manifest can manage packages across Debian, Red Hat, and other distributions without modification. The ecosystem includes a module system for sharing reusable configuration code through Puppet Forge, Facter for gathering system facts, and Hiera for separating data from code. Puppet supports environments for testing changes before production rollout and provides detailed reporting on configuration drift and enforcement actions.

参数

apply
Compile and apply a Puppet manifest locally.
agent
Request a catalog from a Puppet server and enforce it.
parser
Validate Puppet manifest syntax.
module
Install, list, upgrade, and manage Puppet modules.
resource
Inspect and manipulate resources on the system.
config
View and change Puppet configuration settings.
ssl
Manage SSL keys and certificates.
help
Display help for subcommands.
--test
Run the agent once in the foreground with verbose output.
--noop
Simulate changes without applying them (dry run).
--verbose
Enable verbose logging.
--debug
Enable full debug logging.
--environment _env_
Select a specific Puppet environment.

FAQ

What is the puppet command used for?

puppet is a configuration management tool that automates the provisioning and management of infrastructure using a declarative language. Administrators describe the desired state of systems through manifests written in Puppet's DSL, and the tool ensures machines converge to that state by installing packages, managing files, configuring services, and handling users. Puppet operates in two modes: a client-server architecture where agents pull catalogs from a Puppet server, and a standalone mode using puppet apply for local manifest execution. The resource abstraction layer handles platform differences automatically, so the same manifest can manage packages across Debian, Red Hat, and other distributions without modification. The ecosystem includes a module system for sharing reusable configuration code through Puppet Forge, Facter for gathering system facts, and Hiera for separating data from code. Puppet supports environments for testing changes before production rollout and provides detailed reporting on configuration drift and enforcement actions.

How do I run a basic puppet example?

Run `puppet apply [manifest.pp]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does apply do in puppet?

Compile and apply a Puppet manifest locally.