~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to lib/puppet/face/node.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'puppet/indirector/face'
 
2
Puppet::Indirector::Face.define(:node, '0.0.1') do
 
3
  copyright "Puppet Labs", 2011
 
4
  license   "Apache 2 license; see COPYING"
 
5
 
 
6
  summary "View and manage node definitions."
 
7
  description <<-'EOT'
 
8
    This subcommand interacts with node objects, which are used by Puppet to
 
9
    build a catalog. A node object consists of the node's facts, environment,
 
10
    node parameters (exposed in the parser as top-scope variables), and classes.
 
11
  EOT
 
12
 
 
13
  get_action(:destroy).summary "Invalid for this subcommand."
 
14
  get_action(:search).summary "Invalid for this subcommand."
 
15
  get_action(:save).summary "Invalid for this subcommand."
 
16
  get_action(:save).description "Invalid for this subcommand."
 
17
 
 
18
  find = get_action(:find)
 
19
  find.summary "Retrieve a node object."
 
20
  find.arguments "<host>"
 
21
  find.returns <<-'EOT'
 
22
    A hash containing the node's `classes`, `environment`, `expiration`, `name`,
 
23
    `parameters` (its facts, combined with any ENC-set parameters), and `time`.
 
24
    When used from the Ruby API: a Puppet::Node object.
 
25
 
 
26
    RENDERING ISSUES: Rendering as string and json are currently broken;
 
27
    node objects can only be rendered as yaml.
 
28
  EOT
 
29
  find.examples <<-'EOT'
 
30
    Retrieve an "empty" (no classes, no ENC-imposed parameters, and an
 
31
    environment of "production") node:
 
32
 
 
33
    $ puppet node find somenode.puppetlabs.lan --terminus plain --render-as yaml
 
34
 
 
35
    Retrieve a node using the puppet master's configured ENC:
 
36
 
 
37
    $ puppet node find somenode.puppetlabs.lan --terminus exec --mode master --render-as yaml
 
38
 
 
39
    Retrieve the same node from the puppet master:
 
40
 
 
41
    $ puppet node find somenode.puppetlabs.lan --terminus rest --render-as yaml
 
42
  EOT
 
43
end