1PUPPET-APPLY(8) Puppet manual PUPPET-APPLY(8)
2
3
4
6 puppet-apply - Apply Puppet manifests locally
7
9 Applies a standalone Puppet manifest to the local system.
10
12 puppet apply [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
13 [-e|--execute] [--detailed-exitcodes] [-L|--loadclasses] [-l|--logdest
14 syslog|eventlog|ABS FILEPATH|console] [--noop] [--catalog catalog]
15 [--write-catalog-summary] file
16
18 This is the standalone puppet execution tool; use it to apply individ‐
19 ual manifests.
20
21 When provided with a modulepath, via command line or config file, pup‐
22 pet apply can effectively mimic the catalog that would be served by
23 puppet master with access to the same modules, although there are some
24 subtle differences. When combined with scheduling and an automated sys‐
25 tem for pushing manifests, this can be used to implement a serverless
26 Puppet site.
27
28 Most users should use ´puppet agent´ and ´puppet master´ for site-wide
29 manifests.
30
32 Note that any setting that´s valid in the configuration file is also a
33 valid long argument. For example, ´tags´ is a valid setting, so you can
34 specify ´--tags class,tag´ as an argument.
35
36 See the configuration file documentation at https://pup‐
37 pet.com/docs/puppet/latest/configuration.html for the full list of
38 acceptable parameters. A commented list of all configuration options
39 can also be generated by running puppet with ´--genconfig´.
40
41 · --debug: Enable full debugging.
42
43 · --detailed-exitcodes: Provide extra information about the run via
44 exit codes. If enabled, ´puppet apply´ will use the following exit
45 codes:
46
47 0: The run succeeded with no changes or failures; the system was
48 already in the desired state.
49
50 1: The run failed.
51
52 2: The run succeeded, and some resources were changed.
53
54 4: The run succeeded, and some resources failed.
55
56 6: The run succeeded, and included both changes and failures.
57
58 · --help: Print this help message
59
60 · --loadclasses: Load any stored classes. ´puppet agent´ caches con‐
61 figured classes (usually at /etc/puppetlabs/puppet/classes.txt),
62 and setting this option causes all of those classes to be set in
63 your puppet manifest.
64
65 · --logdest: Where to send log messages. Choose between ´syslog´ (the
66 POSIX syslog service), ´eventlog´ (the Windows Event Log), ´con‐
67 sole´, or the path to a log file. Defaults to ´console´.
68
69 A path ending with ´.json´ will receive structured output in JSON
70 format. The log file will not have an ending ´]´ automatically
71 written to it due to the appending nature of logging. It must be
72 appended manually to make the content valid JSON.
73
74 · --noop: Use ´noop´ mode where Puppet runs in a no-op or dry-run
75 mode. This is useful for seeing what changes Puppet will make with‐
76 out actually executing the changes.
77
78 · --execute: Execute a specific piece of Puppet code
79
80 · --test: Enable the most common options used for testing. These are
81 ´verbose´, ´detailed-exitcodes´ and ´show_diff´.
82
83 · --verbose: Print extra information.
84
85 · --catalog: Apply a JSON catalog (such as one generated with ´puppet
86 master --compile´). You can either specify a JSON file or pipe in
87 JSON from standard input.
88
89 · --write-catalog-summary After compiling the catalog saves the
90 resource list and classes list to the node in the state directory
91 named classes.txt and resources.txt
92
93
94
96 $ puppet apply -l /tmp/manifest.log manifest.pp
97 $ puppet apply --modulepath=/root/dev/modules -e "include ntpd::server"
98 $ puppet apply --catalog catalog.json
99
101 Luke Kanies
102
104 Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0
105 License
106
107
108
109Puppet, Inc. April 2020 PUPPET-APPLY(8)