puppet 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/CHANGELOG +123 -0
- data/conf/redhat/puppet.spec +8 -2
- data/conf/solaris/smf/svc-puppetd +1 -1
- data/conf/solaris/smf/svc-puppetmasterd +1 -1
- data/conf/suse/client.init +4 -4
- data/conf/suse/fileserver.conf +12 -0
- data/conf/suse/logrotate +10 -0
- data/conf/suse/puppet.conf +25 -0
- data/conf/suse/puppet.spec +114 -49
- data/conf/suse/ruby-env.patch +17 -0
- data/conf/suse/server.init +4 -4
- data/ext/logcheck/puppet +23 -23
- data/ext/puppet-load.rb +357 -0
- data/ext/puppetstoredconfigclean.rb +3 -3
- data/ext/rack/files/config.ru +3 -5
- data/ext/vim/syntax/puppet.vim +6 -5
- data/install.rb +12 -11
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +3 -1
- data/lib/puppet/application.rb +2 -3
- data/lib/puppet/application/agent.rb +4 -0
- data/lib/puppet/application/apply.rb +14 -6
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/doc.rb +2 -36
- data/lib/puppet/application/master.rb +0 -3
- data/lib/puppet/application/queue.rb +1 -0
- data/lib/puppet/configurer.rb +4 -0
- data/lib/puppet/daemon.rb +1 -1
- data/lib/puppet/defaults.rb +38 -44
- data/lib/puppet/file_serving/indirection_hooks.rb +2 -2
- data/lib/puppet/indirector/facts/memory.rb +1 -1
- data/lib/puppet/indirector/node/exec.rb +1 -1
- data/lib/puppet/indirector/node/ldap.rb +9 -53
- data/lib/puppet/indirector/node/memory.rb +1 -1
- data/lib/puppet/indirector/yaml.rb +6 -9
- data/lib/puppet/network/format_handler.rb +6 -0
- data/lib/puppet/network/formats.rb +4 -4
- data/lib/puppet/network/http/handler.rb +1 -1
- data/lib/puppet/network/http/rack.rb +3 -0
- data/lib/puppet/network/http/rack/rest.rb +1 -1
- data/lib/puppet/network/rest_authconfig.rb +6 -3
- data/lib/puppet/node/environment.rb +15 -5
- data/lib/puppet/parameter/value_collection.rb +3 -3
- data/lib/puppet/parser/ast/function.rb +0 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/resource.rb +4 -3
- data/lib/puppet/parser/ast/resource_reference.rb +9 -2
- data/lib/puppet/parser/compiler.rb +12 -14
- data/lib/puppet/parser/files.rb +1 -1
- data/lib/puppet/parser/functions.rb +2 -2
- data/lib/puppet/parser/functions/defined.rb +1 -1
- data/lib/puppet/parser/functions/extlookup.rb +157 -0
- data/lib/puppet/parser/functions/file.rb +1 -1
- data/lib/puppet/parser/functions/inline_template.rb +6 -5
- data/lib/puppet/parser/functions/md5.rb +5 -0
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +19 -19
- data/lib/puppet/parser/functions/require.rb +2 -3
- data/lib/puppet/parser/functions/split.rb +1 -1
- data/lib/puppet/parser/functions/sprintf.rb +1 -1
- data/lib/puppet/parser/functions/template.rb +4 -2
- data/lib/puppet/parser/functions/versioncmp.rb +12 -12
- data/lib/puppet/parser/lexer.rb +13 -14
- data/lib/puppet/parser/resource.rb +2 -7
- data/lib/puppet/parser/resource/param.rb +1 -1
- data/lib/puppet/parser/scope.rb +35 -0
- data/lib/puppet/parser/type_loader.rb +1 -1
- data/lib/puppet/property.rb +5 -5
- data/lib/puppet/provider.rb +3 -3
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +3 -3
- data/lib/puppet/provider/group/pw.rb +1 -1
- data/lib/puppet/provider/package/apple.rb +1 -1
- data/lib/puppet/provider/package/apt.rb +5 -1
- data/lib/puppet/provider/package/aptitude.rb +1 -1
- data/lib/puppet/provider/package/aptrpm.rb +1 -1
- data/lib/puppet/provider/package/blastwave.rb +1 -1
- data/lib/puppet/provider/package/dpkg.rb +2 -2
- data/lib/puppet/provider/package/fink.rb +1 -1
- data/lib/puppet/provider/package/gem.rb +1 -1
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +1 -1
- data/lib/puppet/provider/package/rug.rb +1 -1
- data/lib/puppet/provider/package/sunfreeware.rb +2 -2
- data/lib/puppet/provider/package/up2date.rb +1 -1
- data/lib/puppet/provider/package/urpmi.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/package/zypper.rb +1 -1
- data/lib/puppet/provider/service/base.rb +1 -1
- data/lib/puppet/provider/service/bsd.rb +2 -2
- data/lib/puppet/provider/service/debian.rb +2 -2
- data/lib/puppet/provider/service/gentoo.rb +2 -2
- data/lib/puppet/provider/service/init.rb +2 -2
- data/lib/puppet/provider/service/redhat.rb +2 -2
- data/lib/puppet/provider/user/ldap.rb +3 -3
- data/lib/puppet/provider/user/pw.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/host.rb +1 -0
- data/lib/puppet/reference/configuration.rb +37 -34
- data/lib/puppet/reference/indirection.rb +3 -4
- data/lib/puppet/reference/metaparameter.rb +0 -8
- data/lib/puppet/reference/network.rb +6 -4
- data/lib/puppet/reference/providers.rb +4 -4
- data/lib/puppet/reference/report.rb +5 -6
- data/lib/puppet/reference/type.rb +14 -14
- data/lib/puppet/reports/http.rb +1 -1
- data/lib/puppet/reports/rrdgraph.rb +8 -9
- data/lib/puppet/reports/store.rb +2 -2
- data/lib/puppet/reports/tagmail.rb +12 -13
- data/lib/puppet/resource.rb +15 -115
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/resource/type.rb +26 -3
- data/lib/puppet/resource/type_collection.rb +3 -6
- data/lib/puppet/simple_graph.rb +4 -5
- data/lib/puppet/transaction/resource_harness.rb +1 -1
- data/lib/puppet/type.rb +100 -92
- data/lib/puppet/type/augeas.rb +44 -45
- data/lib/puppet/type/computer.rb +2 -2
- data/lib/puppet/type/cron.rb +29 -29
- data/lib/puppet/type/exec.rb +66 -67
- data/lib/puppet/type/file.rb +25 -25
- data/lib/puppet/type/file/content.rb +7 -1
- data/lib/puppet/type/file/ensure.rb +13 -13
- data/lib/puppet/type/file/mode.rb +6 -6
- data/lib/puppet/type/file/selcontext.rb +5 -5
- data/lib/puppet/type/file/source.rb +36 -26
- data/lib/puppet/type/filebucket.rb +5 -6
- data/lib/puppet/type/group.rb +1 -2
- data/lib/puppet/type/host.rb +3 -6
- data/lib/puppet/type/k5login.rb +3 -3
- data/lib/puppet/type/macauthorization.rb +1 -2
- data/lib/puppet/type/mailalias.rb +0 -1
- data/lib/puppet/type/maillist.rb +0 -1
- data/lib/puppet/type/mcx.rb +9 -9
- data/lib/puppet/type/mount.rb +9 -10
- data/lib/puppet/type/notify.rb +0 -1
- data/lib/puppet/type/package.rb +34 -36
- data/lib/puppet/type/resources.rb +1 -5
- data/lib/puppet/type/schedule.rb +9 -12
- data/lib/puppet/type/selboolean.rb +2 -7
- data/lib/puppet/type/selmodule.rb +3 -4
- data/lib/puppet/type/service.rb +9 -9
- data/lib/puppet/type/ssh_authorized_key.rb +2 -3
- data/lib/puppet/type/sshkey.rb +4 -7
- data/lib/puppet/type/stage.rb +5 -4
- data/lib/puppet/type/tidy.rb +3 -3
- data/lib/puppet/type/user.rb +1 -2
- data/lib/puppet/type/whit.rb +7 -0
- data/lib/puppet/type/yumrepo.rb +16 -3
- data/lib/puppet/type/zfs.rb +1 -2
- data/lib/puppet/type/zone.rb +28 -28
- data/lib/puppet/type/zpool.rb +10 -5
- data/lib/puppet/util/autoload.rb +17 -5
- data/lib/puppet/util/cacher.rb +15 -10
- data/lib/puppet/util/command_line/puppetdoc +5 -5
- data/lib/puppet/util/command_line/puppetrun +0 -2
- data/lib/puppet/util/command_line/ralsh +13 -13
- data/lib/puppet/util/docs.rb +5 -12
- data/lib/puppet/util/monkey_patches.rb +5 -2
- data/lib/puppet/util/nagios_maker.rb +4 -5
- data/lib/puppet/util/provider_features.rb +2 -2
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/rdoc/parser.rb +5 -3
- data/lib/puppet/util/reference.rb +3 -52
- data/man/man5/puppet.conf.5 +2072 -1526
- data/man/man8/filebucket.8 +104 -106
- data/man/man8/pi.8 +14 -47
- data/man/man8/puppet.8 +8 -9
- data/man/man8/puppetca.8 +168 -129
- data/man/man8/puppetd.8 +282 -226
- data/man/man8/puppetdoc.8 +103 -103
- data/man/man8/puppetmasterd.8 +51 -71
- data/man/man8/puppetqd.8 +18 -53
- data/man/man8/puppetrun.8 +163 -143
- data/man/man8/ralsh.8 +77 -114
- data/spec/integration/indirector/bucket_file/rest_spec.rb +1 -0
- data/spec/integration/indirector/certificate/rest_spec.rb +1 -0
- data/spec/integration/indirector/certificate_request/rest_spec.rb +1 -0
- data/spec/integration/indirector/certificate_revocation_list/rest_spec.rb +1 -0
- data/spec/integration/indirector/report/rest_spec.rb +1 -0
- data/spec/integration/indirector/rest_spec.rb +1 -0
- data/spec/integration/network/server/webrick_spec.rb +1 -0
- data/spec/integration/parser/compiler_spec.rb +43 -0
- data/spec/integration/provider/mailalias/aliases_spec.rb +5 -5
- data/spec/integration/ssl/certificate_authority_spec.rb +1 -0
- data/spec/integration/ssl/certificate_request_spec.rb +1 -0
- data/spec/integration/ssl/certificate_revocation_list_spec.rb +1 -0
- data/spec/integration/ssl/host_spec.rb +1 -0
- data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +0 -1
- data/spec/monkey_patches/publicize_methods.rb +11 -0
- data/spec/shared_behaviours/file_serving.rb +12 -1
- data/spec/spec_helper.rb +6 -25
- data/spec/unit/application/apply_spec.rb +22 -4
- data/spec/unit/application/cert_spec.rb +1 -1
- data/spec/unit/application/doc_spec.rb +0 -19
- data/spec/unit/application/master_spec.rb +1 -1
- data/spec/unit/application_spec.rb +2 -12
- data/spec/unit/indirector/node/ldap_spec.rb +19 -21
- data/spec/unit/indirector/yaml_spec.rb +18 -6
- data/spec/unit/network/http/rack/rest_spec.rb +3 -3
- data/spec/unit/network/http/webrick/rest_spec.rb +1 -0
- data/spec/unit/node/environment_spec.rb +32 -3
- data/spec/unit/node/facts_spec.rb +13 -2
- data/spec/unit/parameter/value_collection_spec.rb +2 -2
- data/spec/unit/parser/ast/leaf_spec.rb +4 -0
- data/spec/unit/parser/ast/resource_reference_spec.rb +0 -5
- data/spec/unit/parser/ast/resource_spec.rb +7 -0
- data/spec/unit/parser/compiler_spec.rb +12 -1
- data/spec/unit/parser/files_spec.rb +3 -3
- data/spec/unit/parser/functions/extlookup_spec.rb +95 -0
- data/spec/unit/parser/functions/include_spec.rb +33 -0
- data/spec/unit/parser/functions/require_spec.rb +1 -1
- data/spec/unit/parser/functions/tag_spec.rb +1 -0
- data/spec/unit/parser/lexer_spec.rb +10 -1
- data/spec/unit/parser/resource_spec.rb +3 -9
- data/spec/unit/parser/type_loader_spec.rb +1 -1
- data/spec/unit/provider/ssh_authorized_key/parsed_spec.rb +4 -2
- data/spec/unit/rails/resource_spec.rb +1 -1
- data/spec/unit/reports/tagmail_spec.rb +2 -2
- data/spec/unit/resource/catalog_spec.rb +1 -1
- data/spec/unit/resource/type_collection_spec.rb +35 -0
- data/spec/unit/resource/type_spec.rb +19 -1
- data/spec/unit/resource_spec.rb +0 -36
- data/spec/unit/simple_graph_spec.rb +12 -2
- data/spec/unit/transaction/resource_harness_spec.rb +1 -1
- data/spec/unit/type/file/content_spec.rb +2 -1
- data/spec/unit/type/schedule_spec.rb +1 -1
- data/spec/unit/type/service_spec.rb +8 -0
- data/spec/unit/type/user_spec.rb +5 -0
- data/spec/unit/util/backups_spec.rb +0 -1
- data/spec/unit/util/rdoc/parser_spec.rb +3 -3
- data/spec/unit/util/rdoc_spec.rb +13 -0
- data/test/certmgr/support.rb +2 -1
- data/test/language/parser.rb +6 -6
- data/test/lib/puppettest.rb +3 -23
- data/test/lib/puppettest/fakes.rb +1 -1
- data/test/lib/puppettest/support/assertions.rb +0 -2
- data/test/lib/puppettest/support/utils.rb +25 -20
- data/test/ral/manager/attributes.rb +4 -1
- metadata +15 -9
- data/conf/suse/puppet.suse.patch +0 -16
- data/ext/extlookup.rb +0 -181
- data/ext/puppetlast +0 -16
- data/tasks/rake/tracdocs.rake +0 -8
- data/test/lib/mocha_standalone.rb +0 -2
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'puppet/indirector/indirection'
|
2
|
-
require 'puppet/
|
2
|
+
require 'puppet/util/checksums'
|
3
3
|
require 'puppet/file_serving/content'
|
4
4
|
require 'puppet/file_serving/metadata'
|
5
5
|
|
@@ -26,9 +26,8 @@ end
|
|
26
26
|
|
27
27
|
reference.header = "This is the list of all indirections, their associated terminus classes, and how you select between them.
|
28
28
|
|
29
|
-
In general, the appropriate terminus class is selected by the application for you (e.g.,
|
30
|
-
terminus for most of its indirected classes), but some classes are tunable via normal settings. These will have
|
31
|
-
documentation listed with them.
|
29
|
+
In general, the appropriate terminus class is selected by the application for you (e.g., `puppet agent` would always use the `rest`
|
30
|
+
terminus for most of its indirected classes), but some classes are tunable via normal settings. These will have `terminus setting` documentation listed with them.
|
32
31
|
|
33
32
|
|
34
33
|
"
|
@@ -29,14 +29,6 @@ metaparameter = Puppet::Util::Reference.newreference :metaparameter, :doc => "Al
|
|
29
29
|
a.to_s <=> b.to_s
|
30
30
|
}.each { |param|
|
31
31
|
str += paramwrap(param.to_s, scrub(Puppet::Type.metaparamdoc(param)), :level => 4)
|
32
|
-
#puts "<dt>#{param}</dt>"
|
33
|
-
#puts tab(1) + Puppet::Type.metaparamdoc(param).scrub.indent($tab)gsub(/\n\s*/,' ')
|
34
|
-
#puts "<dd>"
|
35
|
-
#puts indent(scrub(Puppet::Type.metaparamdoc(param)), $tab)
|
36
|
-
#puts scrub(Puppet::Type.metaparamdoc(param))
|
37
|
-
#puts "</dd>"
|
38
|
-
|
39
|
-
#puts ""
|
40
32
|
}
|
41
33
|
rescue => detail
|
42
34
|
puts detail.backtrace
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'puppet/network/handler'
|
2
|
+
|
1
3
|
network = Puppet::Util::Reference.newreference :network, :depth => 2, :doc => "Available network handlers and clients" do
|
2
4
|
ret = ""
|
3
5
|
Puppet::Network::Handler.subclasses.sort { |a,b| a.to_s <=> b.to_s }.each do |name|
|
@@ -27,11 +29,11 @@ on the server, and the client knows how to call the handler's methods
|
|
27
29
|
appropriately.
|
28
30
|
|
29
31
|
Most handlers are meant to be started on the server, usually within
|
30
|
-
|
31
|
-
usually within
|
32
|
+
`puppet master`, and the clients are mostly started on the client,
|
33
|
+
usually within `puppet agent`.
|
32
34
|
|
33
35
|
You can find the server-side handler for each interface at
|
34
|
-
|
35
|
-
|
36
|
+
`puppet/network/handler/<name>.rb` and the client class at
|
37
|
+
`puppet/network/client/<name>.rb`.
|
36
38
|
|
37
39
|
"
|
@@ -47,7 +47,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
47
47
|
|
48
48
|
# Add the suitability note
|
49
49
|
if missing = provider.suitable?(false) and missing.empty?
|
50
|
-
data << "
|
50
|
+
data << "*X*"
|
51
51
|
suit = true
|
52
52
|
functional = true
|
53
53
|
else
|
@@ -86,7 +86,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
86
86
|
# Add a note for every feature
|
87
87
|
features.each do |feature|
|
88
88
|
if provider.features.include?(feature)
|
89
|
-
data << "
|
89
|
+
data << "*X*"
|
90
90
|
else
|
91
91
|
data << ""
|
92
92
|
end
|
@@ -95,7 +95,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
95
95
|
|
96
96
|
ret += h(type.name.to_s + "_", 2)
|
97
97
|
|
98
|
-
ret += "
|
98
|
+
ret += "[#{type.name}](#{"http://docs.puppetlabs.com/references/stable/type.html##{type.name}"})\n\n"
|
99
99
|
ret += option("Default provider", default)
|
100
100
|
ret += doctable(headers, table_data)
|
101
101
|
|
@@ -111,7 +111,7 @@ providers = Puppet::Util::Reference.newreference :providers, :title => "Provider
|
|
111
111
|
ret
|
112
112
|
end
|
113
113
|
providers.header = "
|
114
|
-
Puppet resource types are usually backed by multiple implementations called
|
114
|
+
Puppet resource types are usually backed by multiple implementations called `providers`,
|
115
115
|
which handle variance between platforms and tools.
|
116
116
|
|
117
117
|
Different providers are suitable or unsuitable on different platforms based on things
|
@@ -7,16 +7,15 @@ end
|
|
7
7
|
report.header = "
|
8
8
|
Puppet clients can report back to the server after each transaction. This
|
9
9
|
transaction report is sent as a YAML dump of the
|
10
|
-
|
10
|
+
`Puppet::Transaction::Report` class and includes every log message that was
|
11
11
|
generated during the transaction along with as many metrics as Puppet knows how
|
12
|
-
to collect. See
|
13
|
-
for more information on how to use reports.
|
12
|
+
to collect. See [Reports and Reporting](http://projects.puppetlabs.com/projects/puppet/wiki/Reports_And_Reporting) for more information on how to use reports.
|
14
13
|
|
15
14
|
Currently, clients default to not sending in reports; you can enable reporting
|
16
|
-
by setting the
|
15
|
+
by setting the `report` parameter to true.
|
17
16
|
|
18
|
-
To use a report, set the
|
19
|
-
reports must be comma-separated. You can also specify
|
17
|
+
To use a report, set the `reports` parameter on the server; multiple
|
18
|
+
reports must be comma-separated. You can also specify `none` to disable
|
20
19
|
reports entirely.
|
21
20
|
|
22
21
|
Puppet provides multiple report handlers that will process client reports:
|
@@ -16,25 +16,25 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource
|
|
16
16
|
- The *namevar* is the parameter used to uniquely identify a type instance.
|
17
17
|
This is the parameter that gets assigned when a string is provided before
|
18
18
|
the colon in a type declaration. In general, only developers will need to
|
19
|
-
worry about which parameter is the
|
19
|
+
worry about which parameter is the `namevar`.
|
20
20
|
|
21
|
-
In the following code
|
21
|
+
In the following code:
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
file { "/etc/passwd":
|
24
|
+
owner => root,
|
25
|
+
group => root,
|
26
|
+
mode => 644
|
27
|
+
}
|
28
28
|
|
29
|
-
|
30
|
-
dependency handling), and because
|
31
|
-
string is assigned to the
|
29
|
+
`/etc/passwd` is considered the title of the file object (used for things like
|
30
|
+
dependency handling), and because `path` is the namevar for `file`, that
|
31
|
+
string is assigned to the `path` parameter.
|
32
32
|
|
33
|
-
- *Parameters* determine the specific configuration of the instance. They either
|
33
|
+
- *Parameters* determine the specific configuration of the instance. They either
|
34
34
|
directly modify the system (internally, these are called properties) or they affect
|
35
|
-
how the instance behaves (e.g., adding a search path for
|
35
|
+
how the instance behaves (e.g., adding a search path for `exec` instances or determining recursion on `file` instances).
|
36
36
|
|
37
|
-
- *Providers* provide low-level functionality for a given resource type. This is
|
37
|
+
- *Providers* provide low-level functionality for a given resource type. This is
|
38
38
|
usually in the form of calling out to external commands.
|
39
39
|
|
40
40
|
When required binaries are specified for providers, fully qualifed paths
|
@@ -42,7 +42,7 @@ type = Puppet::Util::Reference.newreference :type, :doc => "All Puppet resource
|
|
42
42
|
binaries indicate that Puppet will search for the binary using the shell
|
43
43
|
path.
|
44
44
|
|
45
|
-
- *Features* are abilities that some providers might not support. You can use the list
|
45
|
+
- *Features* are abilities that some providers might not support. You can use the list
|
46
46
|
of supported features to determine how a given provider can be used.
|
47
47
|
|
48
48
|
Resource types define features they can use, and providers can be tested to see
|
data/lib/puppet/reports/http.rb
CHANGED
@@ -5,7 +5,7 @@ require 'uri'
|
|
5
5
|
Puppet::Reports.register_report(:http) do
|
6
6
|
|
7
7
|
desc <<-DESC
|
8
|
-
Send report information via HTTP to the
|
8
|
+
Send report information via HTTP to the `reporturl`. Each host sends
|
9
9
|
its report as a YAML dump and this sends this YAML to a client via HTTP POST.
|
10
10
|
The YAML is the `report` parameter of the request."
|
11
11
|
DESC
|
@@ -1,12 +1,11 @@
|
|
1
1
|
Puppet::Reports.register_report(:rrdgraph) do
|
2
2
|
desc "Graph all available data about hosts using the RRD library. You
|
3
3
|
must have the Ruby RRDtool library installed to use this report, which
|
4
|
-
you can get from
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
.. _the RubyRRDTool RubyForge page: http://rubyforge.org/projects/rubyrrdtool/
|
4
|
+
you can get from
|
5
|
+
[the RubyRRDTool RubyForge page](http://rubyforge.org/projects/rubyrrdtool/).
|
6
|
+
This package may also be available as `ruby-rrd` or `rrdtool-ruby` in your
|
7
|
+
distribution's package management system. The library and/or package will both
|
8
|
+
require the binary `rrdtool` package from your distribution to be installed.
|
10
9
|
|
11
10
|
This report will create, manage, and graph RRD database files for each
|
12
11
|
of the metrics generated during transactions, and it will create a
|
@@ -14,12 +13,12 @@ Puppet::Reports.register_report(:rrdgraph) do
|
|
14
13
|
point, it will not create a common index file to display links to
|
15
14
|
all hosts.
|
16
15
|
|
17
|
-
All RRD files and graphs get created in the
|
16
|
+
All RRD files and graphs get created in the `rrddir` directory. If
|
18
17
|
you want to serve these publicly, you should be able to just alias that
|
19
18
|
directory in a web server.
|
20
19
|
|
21
|
-
If you really know what you're doing, you can tune the
|
22
|
-
which defaults to the
|
20
|
+
If you really know what you're doing, you can tune the `rrdinterval`,
|
21
|
+
which defaults to the `runinterval`."
|
23
22
|
|
24
23
|
def hostdir
|
25
24
|
@hostdir ||= File.join(Puppet[:rrddir], self.host)
|
data/lib/puppet/reports/store.rb
CHANGED
@@ -2,7 +2,7 @@ require 'puppet'
|
|
2
2
|
|
3
3
|
Puppet::Reports.register_report(:store) do
|
4
4
|
desc "Store the yaml report on disk. Each host sends its report as a YAML dump
|
5
|
-
and this just stores the file on disk, in the
|
5
|
+
and this just stores the file on disk, in the `reportdir` directory.
|
6
6
|
|
7
7
|
These files collect quickly -- one every half hour -- so it is a good idea
|
8
8
|
to perform some maintenance on them if you use this report (it's the only
|
@@ -19,7 +19,7 @@ Puppet::Reports.register_report(:store) do
|
|
19
19
|
:owner => 'service',
|
20
20
|
:group => 'service'
|
21
21
|
},
|
22
|
-
|
22
|
+
|
23
23
|
:noop => [false, "Used by settings internally."]
|
24
24
|
)
|
25
25
|
|
@@ -6,12 +6,12 @@ require 'time'
|
|
6
6
|
|
7
7
|
Puppet::Reports.register_report(:tagmail) do
|
8
8
|
desc "This report sends specific log messages to specific email addresses
|
9
|
-
based on the tags in the log messages.
|
10
|
-
`UsingTags tag documentation`:trac: for more information
|
11
|
-
on tags.
|
9
|
+
based on the tags in the log messages.
|
12
10
|
|
13
|
-
|
14
|
-
|
11
|
+
See the [UsingTags tag documentation](http://projects.puppetlabs.com/projects/puppet/wiki/Using_Tags) for more information on tags.
|
12
|
+
|
13
|
+
To use this report, you must create a `tagmail.conf` (in the location
|
14
|
+
specified by `tagmap`). This is a simple file that maps tags to
|
15
15
|
email addresses: Any log messages in the report that match the specified
|
16
16
|
tags will be sent to the specified email addresses.
|
17
17
|
|
@@ -20,21 +20,20 @@ Puppet::Reports.register_report(:tagmail) do
|
|
20
20
|
the email addresses by a colon, and the email addresses should also
|
21
21
|
be comma-separated.
|
22
22
|
|
23
|
-
Lastly, there is an
|
23
|
+
Lastly, there is an `all` tag that will always match all log messages.
|
24
24
|
|
25
|
-
Here is an example tagmail.conf
|
25
|
+
Here is an example `tagmail.conf`:
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
all: me@domain.com
|
28
|
+
webserver, !mailserver: httpadmins@domain.com
|
29
29
|
|
30
|
-
This will send all messages to
|
31
|
-
webservers that are not also from mailservers to
|
30
|
+
This will send all messages to `me@domain.com`, and all messages from
|
31
|
+
webservers that are not also from mailservers to `httpadmins@domain.com`.
|
32
32
|
|
33
33
|
If you are using anti-spam controls, such as grey-listing, on your mail
|
34
|
-
server you should whitelist the sending email (controlled by
|
34
|
+
server you should whitelist the sending email (controlled by `reportform` configuration option) to ensure your email is not discarded as spam.
|
35
35
|
"
|
36
36
|
|
37
|
-
|
38
37
|
# Find all matching messages.
|
39
38
|
def match(taglists)
|
40
39
|
matching_logs = []
|
data/lib/puppet/resource.rb
CHANGED
@@ -13,7 +13,7 @@ class Puppet::Resource
|
|
13
13
|
extend Puppet::Util::Pson
|
14
14
|
include Enumerable
|
15
15
|
attr_accessor :file, :line, :catalog, :exported, :virtual, :validate_parameters, :strict
|
16
|
-
attr_reader :
|
16
|
+
attr_reader :type, :title
|
17
17
|
|
18
18
|
require 'puppet/indirector'
|
19
19
|
extend Puppet::Indirector
|
@@ -157,27 +157,26 @@ class Puppet::Resource
|
|
157
157
|
# Create our resource.
|
158
158
|
def initialize(type, title = nil, attributes = {})
|
159
159
|
@parameters = {}
|
160
|
-
@namespaces = [""]
|
161
160
|
|
162
|
-
# Set things like
|
161
|
+
# Set things like strictness first.
|
163
162
|
attributes.each do |attr, value|
|
164
163
|
next if attr == :parameters
|
165
164
|
send(attr.to_s + "=", value)
|
166
165
|
end
|
167
166
|
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
167
|
+
@type, @title = extract_type_and_title(type, title)
|
168
|
+
|
169
|
+
@type = munge_type_name(@type)
|
170
|
+
|
171
|
+
if @type == "Class"
|
172
|
+
@title = :main if @title == ""
|
173
|
+
@title = munge_type_name(@title)
|
174
|
+
end
|
174
175
|
|
175
176
|
if params = attributes[:parameters]
|
176
177
|
extract_parameters(params)
|
177
178
|
end
|
178
179
|
|
179
|
-
resolve_type_and_title
|
180
|
-
|
181
180
|
tag(self.type)
|
182
181
|
tag(self.title) if valid_tag?(self.title)
|
183
182
|
|
@@ -193,17 +192,12 @@ class Puppet::Resource
|
|
193
192
|
return(catalog ? catalog.resource(to_s) : nil)
|
194
193
|
end
|
195
194
|
|
196
|
-
def title=(value)
|
197
|
-
@unresolved_title = value
|
198
|
-
@title = nil
|
199
|
-
end
|
200
|
-
|
201
195
|
def resource_type
|
202
|
-
|
203
|
-
when "Class";
|
204
|
-
when "Node";
|
196
|
+
case type
|
197
|
+
when "Class"; known_resource_types.hostclass(title == :main ? "" : title)
|
198
|
+
when "Node"; known_resource_types.node(title)
|
205
199
|
else
|
206
|
-
|
200
|
+
Puppet::Type.type(type.to_s.downcase.to_sym) || known_resource_types.definition(type)
|
207
201
|
end
|
208
202
|
end
|
209
203
|
|
@@ -314,28 +308,6 @@ class Puppet::Resource
|
|
314
308
|
self
|
315
309
|
end
|
316
310
|
|
317
|
-
# We have to lazy-evaluate this.
|
318
|
-
def title=(value)
|
319
|
-
@title = nil
|
320
|
-
@unresolved_title = value
|
321
|
-
end
|
322
|
-
|
323
|
-
# We have to lazy-evaluate this.
|
324
|
-
def type=(value)
|
325
|
-
@type = nil
|
326
|
-
@unresolved_type = value || "Class"
|
327
|
-
end
|
328
|
-
|
329
|
-
def title
|
330
|
-
resolve_type_and_title unless @title
|
331
|
-
@title
|
332
|
-
end
|
333
|
-
|
334
|
-
def type
|
335
|
-
resolve_type_and_title unless @type
|
336
|
-
@type
|
337
|
-
end
|
338
|
-
|
339
311
|
def valid_parameter?(name)
|
340
312
|
resource_type.valid_parameter?(name)
|
341
313
|
end
|
@@ -346,29 +318,6 @@ class Puppet::Resource
|
|
346
318
|
|
347
319
|
private
|
348
320
|
|
349
|
-
def find_node(name)
|
350
|
-
known_resource_types.node(name)
|
351
|
-
end
|
352
|
-
|
353
|
-
def find_hostclass(title)
|
354
|
-
name = title == :main ? "" : title
|
355
|
-
known_resource_types.find_hostclass(namespaces, name)
|
356
|
-
end
|
357
|
-
|
358
|
-
def find_resource_type(type)
|
359
|
-
# It still works fine without the type == 'class' short-cut, but it is a lot slower.
|
360
|
-
return nil if ["class", "node"].include? type.to_s.downcase
|
361
|
-
find_builtin_resource_type(type) || find_defined_resource_type(type)
|
362
|
-
end
|
363
|
-
|
364
|
-
def find_builtin_resource_type(type)
|
365
|
-
Puppet::Type.type(type.to_s.downcase.to_sym)
|
366
|
-
end
|
367
|
-
|
368
|
-
def find_defined_resource_type(type)
|
369
|
-
known_resource_types.find_definition(namespaces, type.to_s.downcase)
|
370
|
-
end
|
371
|
-
|
372
321
|
# Produce a canonical method name.
|
373
322
|
def parameter_name(param)
|
374
323
|
param = param.to_s.downcase.to_sym
|
@@ -378,10 +327,6 @@ class Puppet::Resource
|
|
378
327
|
param
|
379
328
|
end
|
380
329
|
|
381
|
-
def namespaces=(ns)
|
382
|
-
@namespaces = Array(ns)
|
383
|
-
end
|
384
|
-
|
385
330
|
# The namevar for our resource type. If the type doesn't exist,
|
386
331
|
# always use :name.
|
387
332
|
def namevar
|
@@ -428,54 +373,9 @@ class Puppet::Resource
|
|
428
373
|
value.to_s.split("::").collect { |s| s.capitalize }.join("::")
|
429
374
|
end
|
430
375
|
|
431
|
-
# This is an annoyingly complicated method for resolving qualified
|
432
|
-
# types as necessary, and putting them in type or title attributes.
|
433
|
-
def resolve_type_and_title
|
434
|
-
if @unresolved_type
|
435
|
-
@type = resolve_type
|
436
|
-
@unresolved_type = nil
|
437
|
-
end
|
438
|
-
if @unresolved_title
|
439
|
-
@title = resolve_title
|
440
|
-
@unresolved_title = nil
|
441
|
-
end
|
442
|
-
end
|
443
|
-
|
444
|
-
def resolve_type
|
445
|
-
case type = munge_type_name(@unresolved_type)
|
446
|
-
when "Class", "Node";
|
447
|
-
type
|
448
|
-
else
|
449
|
-
# Otherwise, some kind of builtin or defined resource type
|
450
|
-
munge_type_name( (r = find_resource_type(type)) ? r.name : type)
|
451
|
-
end
|
452
|
-
end
|
453
|
-
|
454
|
-
# This method only works if resolve_type was called first
|
455
|
-
def resolve_title
|
456
|
-
case @type
|
457
|
-
when "Node"; return @unresolved_title
|
458
|
-
when "Class";
|
459
|
-
resolve_title_for_class(@unresolved_title)
|
460
|
-
else
|
461
|
-
@unresolved_title
|
462
|
-
end
|
463
|
-
end
|
464
|
-
|
465
|
-
def resolve_title_for_class(title)
|
466
|
-
if title == "" or title == :main
|
467
|
-
return :main
|
468
|
-
end
|
469
|
-
|
470
|
-
if klass = find_hostclass(title)
|
471
|
-
result = klass.name
|
472
|
-
end
|
473
|
-
munge_type_name(result || title)
|
474
|
-
end
|
475
|
-
|
476
376
|
def parse_title
|
477
377
|
h = {}
|
478
|
-
type =
|
378
|
+
type = resource_type
|
479
379
|
if type.respond_to? :title_patterns
|
480
380
|
type.title_patterns.each { |regexp, symbols_and_lambdas|
|
481
381
|
if captures = regexp.match(title.to_s)
|