~ubuntu-branches/ubuntu/trusty/puppet/trusty

« back to all changes in this revision

Viewing changes to lib/puppet/application/agent.rb

  • Committer: Package Import Robot
  • Author(s): Stig Sandbeck Mathisen
  • Date: 2011-10-22 14:08:22 UTC
  • mfrom: (1.1.25) (3.1.32 sid)
  • Revision ID: package-import@ubuntu.com-20111022140822-odxde5lohc45yhuz
Tags: 2.7.6-1
* New upstream release (CVE-2011-3872)
* Remove cherry-picked "groupadd_aix_warning" patch
* Install all new manpages

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
 
101
101
USAGE
102
102
-----
103
 
puppet agent  [-D|--daemonize|--no-daemonize] [-d|--debug]
104
 
  [--detailed-exitcodes] [--disable] [--enable] [-h|--help]
105
 
  [--certname <host name>] [-l|--logdest syslog|<file>|console]
106
 
  [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
107
 
  [--digest <digest>] [--fingerprint] [-V|--version]
108
 
  [-v|--verbose] [-w|--waitforcert <seconds>]
 
103
puppet agent [--certname <name>] [-D|--daemonize|--no-daemonize]
 
104
  [-d|--debug] [--detailed-exitcodes] [--digest <digest>] [--disable] [--enable]
 
105
  [--fingerprint] [-h|--help] [-l|--logdest syslog|<file>|console]
 
106
  [--no-client] [--noop] [-o|--onetime] [--serve <handler>] [-t|--test]
 
107
  [-v|--verbose] [-V|--version] [-w|--waitforcert <seconds>]
109
108
 
110
109
 
111
110
DESCRIPTION
172
171
configuration options can also be generated by running puppet agent with
173
172
'--genconfig'.
174
173
 
 
174
* --certname:
 
175
  Set the certname (unique ID) of the client. The master reads this
 
176
  unique identifying string, which is usually set to the node's
 
177
  fully-qualified domain name, to determine which configurations the
 
178
  node will receive. Use this option to debug setup problems or
 
179
  implement unusual node identification schemes.
 
180
 
175
181
* --daemonize:
176
182
  Send the process into the background. This is the default.
177
183
 
181
187
* --debug:
182
188
  Enable full debugging.
183
189
 
 
190
* --detailed-exitcodes:
 
191
  Provide transaction information via exit codes. If this is enabled, an exit
 
192
  code of '2' means there were changes, an exit code of '4' means there were
 
193
  failures during the transaction, and an exit code of '6' means there were both
 
194
  changes and failures.
 
195
 
184
196
* --digest:
185
197
  Change the certificate fingerprinting digest algorithm. The default is
186
198
  MD5. Valid values depends on the version of OpenSSL installed, but
187
199
  should always at least contain MD5, MD2, SHA1 and SHA256.
188
200
 
189
 
* --detailed-exitcodes:
190
 
  Provide transaction information via exit codes. If this is enabled, an
191
 
  exit code of '2' means there were changes, and an exit code of '4'
192
 
  means that there were failures during the transaction. This option
193
 
  only makes sense in conjunction with --onetime.
194
 
 
195
201
* --disable:
196
202
  Disable working on the local system. This puts a lock file in place,
197
203
  causing 'puppet agent' not to work on the system until the lock file
212
218
 
213
219
  'puppet agent' exits after executing this.
214
220
 
215
 
* --certname:
216
 
  Set the certname (unique ID) of the client. The master reads this
217
 
  unique identifying string, which is usually set to the node's
218
 
  fully-qualified domain name, to determine which configurations the
219
 
  node will receive. Use this option to debug setup problems or
220
 
  implement unusual node identification schemes.
 
221
* --fingerprint:
 
222
  Display the current certificate or certificate signing request
 
223
  fingerprint and then exit. Use the '--digest' option to change the
 
224
  digest algorithm used.
221
225
 
222
226
* --help:
223
227
  Print this help message
230
234
* --no-client:
231
235
  Do not create a config client. This will cause the daemon to run
232
236
  without ever checking for its configuration automatically, and only
233
 
  makes sense
 
237
  makes sense when puppet agent is being run with listen = true in puppet.conf
 
238
  or was started with the `--listen` option.
 
239
 
 
240
* --noop:
 
241
  Use 'noop' mode where the daemon runs in a no-op or dry-run mode. This
 
242
  is useful for seeing what changes Puppet will make without actually
 
243
  executing the changes.
234
244
 
235
245
* --onetime:
236
246
  Run the configuration once. Runs a single (normally daemonized) Puppet
237
247
  run. Useful for interactively running puppet agent when used in
238
248
  conjunction with the --no-daemonize option.
239
249
 
240
 
* --fingerprint:
241
 
  Display the current certificate or certificate signing request
242
 
  fingerprint and then exit. Use the '--digest' option to change the
243
 
  digest algorithm used.
244
 
 
245
250
* --serve:
246
251
  Start another type of server. By default, 'puppet agent' will start a
247
252
  service handler that allows authenticated and authorized remote nodes
256
261
  'verbose', 'ignorecache', 'no-daemonize', 'no-usecacheonfailure',
257
262
  'detailed-exit-codes', 'no-splay', and 'show_diff'.
258
263
 
259
 
* --noop:
260
 
  Use 'noop' mode where the daemon runs in a no-op or dry-run mode. This
261
 
  is useful for seeing what changes Puppet will make without actually
262
 
  executing the changes.
263
 
 
264
264
* --verbose:
265
265
  Turn on verbose reporting.
266
266
 
290
290
  Restart the puppet agent daemon.
291
291
* SIGINT and SIGTERM:
292
292
  Shut down the puppet agent daemon.
293
 
* SIGUSR1: 
 
293
* SIGUSR1:
294
294
  Immediately retrieve and apply configurations from the puppet master.
295
295
 
296
296
AUTHOR
320
320
    unless fingerprint = cert.fingerprint(options[:digest])
321
321
      raise ArgumentError, "Could not get fingerprint for digest '#{options[:digest]}'"
322
322
    end
323
 
    Puppet.notice fingerprint
 
323
    puts fingerprint
324
324
  end
325
325
 
326
326
  def onetime
390
390
  end
391
391
 
392
392
  def setup_listen
393
 
    unless FileTest.exists?(Puppet[:authconfig])
394
 
      Puppet.err "Will not start without authorization file #{Puppet[:authconfig]}"
 
393
    unless FileTest.exists?(Puppet[:rest_authconfig])
 
394
      Puppet.err "Will not start without authorization file #{Puppet[:rest_authconfig]}"
395
395
      exit(14)
396
396
    end
397
397