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
data/lib/puppet/parser/scope.rb
CHANGED
@@ -474,6 +474,41 @@ class Puppet::Parser::Scope
|
|
474
474
|
end
|
475
475
|
end
|
476
476
|
|
477
|
+
def find_resource_type(type)
|
478
|
+
# It still works fine without the type == 'class' short-cut, but it is a lot slower.
|
479
|
+
return nil if ["class", "node"].include? type.to_s.downcase
|
480
|
+
find_builtin_resource_type(type) || find_defined_resource_type(type)
|
481
|
+
end
|
482
|
+
|
483
|
+
def find_builtin_resource_type(type)
|
484
|
+
Puppet::Type.type(type.to_s.downcase.to_sym)
|
485
|
+
end
|
486
|
+
|
487
|
+
def find_defined_resource_type(type)
|
488
|
+
environment.known_resource_types.find_definition(namespaces, type.to_s.downcase)
|
489
|
+
end
|
490
|
+
|
491
|
+
def resolve_type_and_titles(type, titles)
|
492
|
+
raise ArgumentError, "titles must be an array" unless titles.is_a?(Array)
|
493
|
+
|
494
|
+
case type.downcase
|
495
|
+
when "class"
|
496
|
+
# resolve the titles
|
497
|
+
titles = titles.collect do |a_title|
|
498
|
+
hostclass = find_hostclass(a_title)
|
499
|
+
hostclass ? hostclass.name : a_title
|
500
|
+
end
|
501
|
+
when "node"
|
502
|
+
# no-op
|
503
|
+
else
|
504
|
+
# resolve the type
|
505
|
+
resource_type = find_resource_type(type)
|
506
|
+
type = resource_type.name if resource_type
|
507
|
+
end
|
508
|
+
|
509
|
+
return [type, titles]
|
510
|
+
end
|
511
|
+
|
477
512
|
private
|
478
513
|
|
479
514
|
def extend_with_functions_module
|
@@ -88,7 +88,7 @@ class Puppet::Parser::TypeLoader
|
|
88
88
|
nil
|
89
89
|
end
|
90
90
|
if result = yield(filename)
|
91
|
-
Puppet.
|
91
|
+
Puppet.debug "Automatically imported #{name} from #{filename} into #{environment}"
|
92
92
|
result.module_name = modname if modname and result.respond_to?(:module_name=)
|
93
93
|
return result
|
94
94
|
end
|
data/lib/puppet/property.rb
CHANGED
@@ -55,10 +55,10 @@ class Puppet::Property < Puppet::Parameter
|
|
55
55
|
# * <tt>:required_features</tt>: A list of features this value requires.
|
56
56
|
# * <tt>:event</tt>: The event that should be returned when this value is set.
|
57
57
|
# * <tt>:call</tt>: When to call any associated block. The default value
|
58
|
-
# is
|
59
|
-
# provider. You can also specify
|
58
|
+
# is `instead`, which means to call the value instead of calling the
|
59
|
+
# provider. You can also specify `before` or `after`, which will
|
60
60
|
# call both the block and the provider, according to the order you specify
|
61
|
-
# (the
|
61
|
+
# (the `first` refers to when the block is called, not the provider).
|
62
62
|
def self.newvalue(name, options = {}, &block)
|
63
63
|
value = value_collection.newvalue(name, options, &block)
|
64
64
|
|
@@ -181,10 +181,10 @@ class Puppet::Property < Puppet::Parameter
|
|
181
181
|
def log(msg)
|
182
182
|
|
183
183
|
Puppet::Util::Log.create(
|
184
|
-
|
184
|
+
|
185
185
|
:level => resource[:loglevel],
|
186
186
|
:message => msg,
|
187
|
-
|
187
|
+
|
188
188
|
:source => self
|
189
189
|
)
|
190
190
|
end
|
data/lib/puppet/provider.rb
CHANGED
@@ -205,7 +205,7 @@ class Puppet::Provider
|
|
205
205
|
dochook(:defaults) do
|
206
206
|
if @defaults.length > 0
|
207
207
|
return " Default for " + @defaults.collect do |f, v|
|
208
|
-
"
|
208
|
+
"`#{f}` == `#{v}`"
|
209
209
|
end.join(" and ") + "."
|
210
210
|
end
|
211
211
|
end
|
@@ -213,7 +213,7 @@ class Puppet::Provider
|
|
213
213
|
dochook(:commands) do
|
214
214
|
if @commands.length > 0
|
215
215
|
return " Required binaries: " + @commands.collect do |n, c|
|
216
|
-
"
|
216
|
+
"`#{c}`"
|
217
217
|
end.join(", ") + "."
|
218
218
|
end
|
219
219
|
end
|
@@ -221,7 +221,7 @@ class Puppet::Provider
|
|
221
221
|
dochook(:features) do
|
222
222
|
if features.length > 0
|
223
223
|
return " Supported features: " + features.collect do |f|
|
224
|
-
"
|
224
|
+
"`#{f}`"
|
225
225
|
end.join(", ") + "."
|
226
226
|
end
|
227
227
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'puppet/provider/nameservice/objectadd'
|
2
2
|
|
3
3
|
Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameService::ObjectAdd do
|
4
|
-
desc "Group management via
|
4
|
+
desc "Group management via `groupadd` and its ilk.
|
5
5
|
|
6
6
|
The default for most platforms
|
7
7
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'puppet/provider/ldap'
|
2
2
|
|
3
3
|
Puppet::Type.type(:group).provide :ldap, :parent => Puppet::Provider::Ldap do
|
4
|
-
desc "Group management via
|
4
|
+
desc "Group management via `ldap`.
|
5
5
|
|
6
6
|
This provider requires that you have valid values for all of the
|
7
|
-
ldap-related settings, including
|
8
|
-
definitely need settings for
|
7
|
+
ldap-related settings, including `ldapbase`. You will also almost
|
8
|
+
definitely need settings for `ldapuser` and `ldappassword`, so that
|
9
9
|
your clients can write to ldap.
|
10
10
|
|
11
11
|
Note that this provider will automatically generate a GID for you if you do
|
@@ -5,7 +5,7 @@ Puppet::Type.type(:package).provide :apple, :parent => Puppet::Provider::Package
|
|
5
5
|
desc "Package management based on OS X's builtin packaging system. This is
|
6
6
|
essentially the simplest and least functional package system in existence --
|
7
7
|
it only supports installation; no deletion or upgrades. The provider will
|
8
|
-
automatically add the
|
8
|
+
automatically add the `.pkg` extension, so leave that off when specifying
|
9
9
|
the package name."
|
10
10
|
|
11
11
|
confine :operatingsystem => :darwin
|
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
|
|
2
2
|
# Provide sorting functionality
|
3
3
|
include Puppet::Util::Package
|
4
4
|
|
5
|
-
desc "Package management via
|
5
|
+
desc "Package management via `apt-get`."
|
6
6
|
|
7
7
|
has_feature :versionable
|
8
8
|
|
@@ -14,6 +14,10 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
|
|
14
14
|
|
15
15
|
ENV['DEBIAN_FRONTEND'] = "noninteractive"
|
16
16
|
|
17
|
+
# disable common apt helpers to allow non-interactive package installs
|
18
|
+
ENV['APT_LISTBUGS_FRONTEND'] = "none"
|
19
|
+
ENV['APT_LISTCHANGES_FRONTEND'] = "none"
|
20
|
+
|
17
21
|
# A derivative of DPKG; this is how most people actually manage
|
18
22
|
# Debian boxes, and the only thing that differs is that it can
|
19
23
|
# install packages from remote sites.
|
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :aptrpm, :parent => :rpm, :source => :rpm do
|
|
2
2
|
# Provide sorting functionality
|
3
3
|
include Puppet::Util::Package
|
4
4
|
|
5
|
-
desc "Package management via
|
5
|
+
desc "Package management via `apt-get` ported to `rpm`."
|
6
6
|
|
7
7
|
has_feature :versionable
|
8
8
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Packaging using Blastwave's pkg-get program.
|
2
2
|
Puppet::Type.type(:package).provide :blastwave, :parent => :sun, :source => :sun do
|
3
|
-
desc "Package management using Blastwave.org's
|
3
|
+
desc "Package management using Blastwave.org's `pkg-get` command on Solaris."
|
4
4
|
pkgget = "pkg-get"
|
5
5
|
pkgget = "/opt/csw/bin/pkg-get" if FileTest.executable?("/opt/csw/bin/pkg-get")
|
6
6
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'puppet/provider/package'
|
2
2
|
|
3
3
|
Puppet::Type.type(:package).provide :dpkg, :parent => Puppet::Provider::Package do
|
4
|
-
desc "Package management via
|
5
|
-
and not
|
4
|
+
desc "Package management via `dpkg`. Because this only uses `dpkg`
|
5
|
+
and not `apt`, you must specify the source of any packages you want
|
6
6
|
to manage."
|
7
7
|
|
8
8
|
has_feature :holdable
|
@@ -2,7 +2,7 @@ Puppet::Type.type(:package).provide :fink, :parent => :dpkg, :source => :dpkg do
|
|
2
2
|
# Provide sorting functionality
|
3
3
|
include Puppet::Util::Package
|
4
4
|
|
5
|
-
desc "Package management via
|
5
|
+
desc "Package management via `fink`."
|
6
6
|
|
7
7
|
commands :fink => "/sw/bin/fink"
|
8
8
|
commands :aptget => "/sw/bin/apt-get"
|
@@ -3,7 +3,7 @@ require 'uri'
|
|
3
3
|
|
4
4
|
# Ruby gems support.
|
5
5
|
Puppet::Type.type(:package).provide :gem, :parent => Puppet::Provider::Package do
|
6
|
-
desc "Ruby Gem support. If a URL is passed via
|
6
|
+
desc "Ruby Gem support. If a URL is passed via `source`, then that URL is used as the
|
7
7
|
remote gem repository; if a source is present but is not a valid URL, it will be
|
8
8
|
interpreted as the path to a local gem file. If source is not present at all,
|
9
9
|
the gem will be installed from the default gem repositories."
|
@@ -3,7 +3,7 @@ require 'puppet/provider/package'
|
|
3
3
|
# Packaging on OpenBSD. Doesn't work anywhere else that I know of.
|
4
4
|
Puppet::Type.type(:package).provide :openbsd, :parent => Puppet::Provider::Package do
|
5
5
|
include Puppet::Util::Execution
|
6
|
-
desc "OpenBSD's form of
|
6
|
+
desc "OpenBSD's form of `pkg_add` support."
|
7
7
|
|
8
8
|
commands :pkginfo => "pkg_info", :pkgadd => "pkg_add", :pkgdelete => "pkg_delete"
|
9
9
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'puppet/provider/package'
|
2
2
|
# RPM packaging. Should work anywhere that has rpm installed.
|
3
3
|
Puppet::Type.type(:package).provide :rpm, :source => :rpm, :parent => Puppet::Provider::Package do
|
4
|
-
desc "RPM packaging support; should work anywhere with a working
|
4
|
+
desc "RPM packaging support; should work anywhere with a working `rpm`
|
5
5
|
binary."
|
6
6
|
|
7
7
|
has_feature :versionable
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# At this point, it's an exact copy of the Blastwave stuff.
|
2
2
|
Puppet::Type.type(:package).provide :sunfreeware, :parent => :blastwave, :source => :sun do
|
3
|
-
desc "Package management using sunfreeware.com's
|
4
|
-
At this point, support is exactly the same as
|
3
|
+
desc "Package management using sunfreeware.com's `pkg-get` command on Solaris.
|
4
|
+
At this point, support is exactly the same as `blastwave` support and
|
5
5
|
has not actually been tested."
|
6
6
|
commands :pkgget => "pkg-get"
|
7
7
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
Puppet::Type.type(:package).provide :up2date, :parent => :rpm, :source => :rpm do
|
2
|
-
desc "Support for Red Hat's proprietary
|
2
|
+
desc "Support for Red Hat's proprietary `up2date` package update
|
3
3
|
mechanism."
|
4
4
|
|
5
5
|
commands :up2date => "/usr/sbin/up2date-nox"
|
@@ -5,7 +5,7 @@ Puppet::Type.type(:service).provide :base do
|
|
5
5
|
minimum you can specify is a binary for starting the process, and this
|
6
6
|
same binary will be searched for in the process table to stop the
|
7
7
|
service. It is preferable to specify start, stop, and status commands,
|
8
|
-
akin to how you would do so using
|
8
|
+
akin to how you would do so using `init`.
|
9
9
|
|
10
10
|
"
|
11
11
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# Manage FreeBSD services.
|
2
2
|
Puppet::Type.type(:service).provide :bsd, :parent => :init do
|
3
|
-
desc "FreeBSD's (and probably NetBSD?) form of
|
3
|
+
desc "FreeBSD's (and probably NetBSD?) form of `init`-style service management.
|
4
4
|
|
5
|
-
Uses
|
5
|
+
Uses `rc.conf.d` for service enabling and disabling.
|
6
6
|
|
7
7
|
"
|
8
8
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Manage debian services. Start/stop is the same as InitSvc, but enable/disable
|
2
2
|
# is special.
|
3
3
|
Puppet::Type.type(:service).provide :debian, :parent => :init do
|
4
|
-
desc "Debian's form of
|
4
|
+
desc "Debian's form of `init`-style management.
|
5
5
|
|
6
6
|
The only difference is that this supports service enabling and disabling
|
7
|
-
via
|
7
|
+
via `update-rc.d` and determines enabled status via `invoke-rc.d`.
|
8
8
|
|
9
9
|
"
|
10
10
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Manage gentoo services. Start/stop is the same as InitSvc, but enable/disable
|
2
2
|
# is special.
|
3
3
|
Puppet::Type.type(:service).provide :gentoo, :parent => :init do
|
4
|
-
desc "Gentoo's form of
|
4
|
+
desc "Gentoo's form of `init`-style service management.
|
5
5
|
|
6
|
-
Uses
|
6
|
+
Uses `rc-update` for service enabling and disabling.
|
7
7
|
|
8
8
|
"
|
9
9
|
|
@@ -3,9 +3,9 @@
|
|
3
3
|
Puppet::Type.type(:service).provide :init, :parent => :base do
|
4
4
|
desc "Standard init service management.
|
5
5
|
|
6
|
-
This provider assumes that the init script has no
|
6
|
+
This provider assumes that the init script has no `status` command,
|
7
7
|
because so few scripts do, so you need to either provide a status
|
8
|
-
command or specify via
|
8
|
+
command or specify via `hasstatus` that one already exists in the
|
9
9
|
init script.
|
10
10
|
|
11
11
|
"
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# Manage Red Hat services. Start/stop uses /sbin/service and enable/disable uses chkconfig
|
2
2
|
|
3
3
|
Puppet::Type.type(:service).provide :redhat, :parent => :init, :source => :init do
|
4
|
-
desc "Red Hat's (and probably many others) form of
|
4
|
+
desc "Red Hat's (and probably many others) form of `init`-style service management:
|
5
5
|
|
6
|
-
Uses
|
6
|
+
Uses `chkconfig` for service enabling and disabling.
|
7
7
|
|
8
8
|
"
|
9
9
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'puppet/provider/ldap'
|
2
2
|
|
3
3
|
Puppet::Type.type(:user).provide :ldap, :parent => Puppet::Provider::Ldap do
|
4
|
-
desc "User management via
|
4
|
+
desc "User management via `ldap`. This provider requires that you
|
5
5
|
have valid values for all of the ldap-related settings,
|
6
|
-
including
|
7
|
-
for
|
6
|
+
including `ldapbase`. You will also almost definitely need settings
|
7
|
+
for `ldapuser` and `ldappassword`, so that your clients can write
|
8
8
|
to ldap.
|
9
9
|
|
10
10
|
Note that this provider will automatically generate a UID for you if
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'puppet/provider/nameservice/pw'
|
2
2
|
|
3
3
|
Puppet::Type.type(:user).provide :pw, :parent => Puppet::Provider::NameService::PW do
|
4
|
-
desc "User management via
|
4
|
+
desc "User management via `pw` on FreeBSD."
|
5
5
|
|
6
6
|
commands :pw => "pw"
|
7
7
|
has_features :manages_homedir, :allows_duplicates
|
@@ -2,7 +2,7 @@ require 'puppet/util/user_attr'
|
|
2
2
|
|
3
3
|
Puppet::Type.type(:user).provide :user_role_add, :parent => :useradd, :source => :useradd do
|
4
4
|
|
5
|
-
desc "User management inherits
|
5
|
+
desc "User management inherits `useradd` and adds logic to manage roles on Solaris using roleadd."
|
6
6
|
|
7
7
|
defaultfor :operatingsystem => :solaris
|
8
8
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'puppet/provider/nameservice/objectadd'
|
2
2
|
|
3
3
|
Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameService::ObjectAdd do
|
4
|
-
desc "User management via
|
4
|
+
desc "User management via `useradd` and its ilk. Note that you will need to install the `Shadow Password` Ruby library often known as ruby-libshadow to manage user passwords."
|
5
5
|
|
6
6
|
commands :add => "useradd", :delete => "userdel", :modify => "usermod"
|
7
7
|
|
data/lib/puppet/rails/host.rb
CHANGED
@@ -33,7 +33,7 @@ config = Puppet::Util::Reference.newreference(:configuration, :depth => 1, :doc
|
|
33
33
|
# Leave out the section information; it was apparently confusing people.
|
34
34
|
#str += "- **Section**: #{object.section}\n"
|
35
35
|
unless val == ""
|
36
|
-
str += "-
|
36
|
+
str += "- *Default*: #{val}\n"
|
37
37
|
end
|
38
38
|
str += "\n"
|
39
39
|
end
|
@@ -47,7 +47,7 @@ Specifying Configuration Parameters
|
|
47
47
|
|
48
48
|
On The Command-Line
|
49
49
|
+++++++++++++++++++
|
50
|
-
Every Puppet executable (with the exception of
|
50
|
+
Every Puppet executable (with the exception of `puppetdoc`) accepts all of
|
51
51
|
the parameters below, but not all of the arguments make sense for every executable.
|
52
52
|
|
53
53
|
I have tried to be as thorough as possible in the descriptions of the
|
@@ -55,60 +55,61 @@ arguments, so it should be obvious whether an argument is appropriate or not.
|
|
55
55
|
|
56
56
|
These parameters can be supplied to the executables either as command-line
|
57
57
|
options or in the configuration file. For instance, the command-line
|
58
|
-
invocation below would set the configuration directory to
|
58
|
+
invocation below would set the configuration directory to `/private/puppet`:
|
59
59
|
|
60
|
-
|
60
|
+
$ puppet agent --confdir=/private/puppet
|
61
61
|
|
62
62
|
Note that boolean options are turned on and off with a slightly different
|
63
|
-
syntax on the command line
|
63
|
+
syntax on the command line:
|
64
64
|
|
65
|
-
|
65
|
+
$ puppet agent --storeconfigs
|
66
66
|
|
67
|
-
|
67
|
+
$ puppet agent --no-storeconfigs
|
68
68
|
|
69
69
|
The invocations above will enable and disable, respectively, the storage of
|
70
70
|
the client configuration.
|
71
71
|
|
72
72
|
Configuration Files
|
73
73
|
+++++++++++++++++++
|
74
|
+
|
74
75
|
As mentioned above, the configuration parameters can also be stored in a
|
75
76
|
configuration file, located in the configuration directory. As root, the
|
76
|
-
default configuration directory is
|
77
|
-
default configuration directory is
|
78
|
-
executables look for
|
77
|
+
default configuration directory is `/etc/puppet`, and as a regular user, the
|
78
|
+
default configuration directory is `~user/.puppet`. As of 0.23.0, all
|
79
|
+
executables look for `puppet.conf` in their configuration directory
|
79
80
|
(although they previously looked for separate files). For example,
|
80
|
-
|
81
|
-
|
81
|
+
`puppet.conf` is located at `/etc/puppet/puppet.conf` as `root` and
|
82
|
+
`~user/.puppet/puppet.conf` as a regular user by default.
|
82
83
|
|
83
|
-
All executables will set any parameters set within the
|
84
|
-
and each executable will also use one of the
|
85
|
-
``user`` sections.
|
84
|
+
All executables will set any parameters set within the `[main]` section,
|
85
|
+
and each executable will also use one of the `[master]`, `[agent]`.
|
86
86
|
|
87
87
|
File Format
|
88
88
|
'''''''''''
|
89
|
+
|
89
90
|
The file follows INI-style formatting. Here is an example of a very simple
|
90
|
-
|
91
|
+
`puppet.conf` file:
|
91
92
|
|
92
|
-
|
93
|
-
|
94
|
-
|
93
|
+
[main]
|
94
|
+
confdir = /private/puppet
|
95
|
+
storeconfigs = true
|
95
96
|
|
96
97
|
Note that boolean parameters must be explicitly specified as `true` or
|
97
98
|
`false` as seen above.
|
98
99
|
|
99
100
|
If you need to change file parameters (e.g., reset the mode or owner), do
|
100
|
-
so within curly braces on the same line
|
101
|
+
so within curly braces on the same line:
|
101
102
|
|
102
|
-
|
103
|
-
|
103
|
+
[main]
|
104
|
+
myfile = /tmp/whatever {owner = root, mode = 644}
|
104
105
|
|
105
106
|
If you're starting out with a fresh configuration, you may wish to let
|
106
107
|
the executable generate a template configuration file for you by invoking
|
107
108
|
the executable in question with the `--genconfig` command. The executable
|
108
109
|
will print a template configuration to standard output, which can be
|
109
|
-
redirected to a file like so
|
110
|
+
redirected to a file like so:
|
110
111
|
|
111
|
-
|
112
|
+
$ puppet agent --genconfig > /etc/puppet/puppet.conf
|
112
113
|
|
113
114
|
Note that this invocation will replace the contents of any pre-existing
|
114
115
|
`puppet.conf` file, so make a backup of your present config if it contains
|
@@ -117,28 +118,30 @@ valuable information.
|
|
117
118
|
Like the `--genconfig` argument, the executables also accept a `--genmanifest`
|
118
119
|
argument, which will generate a manifest that can be used to manage all of
|
119
120
|
Puppet's directories and files and prints it to standard output. This can
|
120
|
-
likewise be redirected to a file
|
121
|
+
likewise be redirected to a file:
|
121
122
|
|
122
|
-
|
123
|
+
$ puppet agent --genmanifest > /etc/puppet/manifests/site.pp
|
123
124
|
|
124
125
|
Puppet can also create user and group accounts for itself (one `puppet` group
|
125
|
-
and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument
|
126
|
+
and one `puppet` user) if it is invoked as `root` with the `--mkusers` argument:
|
126
127
|
|
127
|
-
|
128
|
+
$ puppet agent --mkusers
|
128
129
|
|
129
130
|
Signals
|
130
131
|
-------
|
131
|
-
The ``puppet agent`` and ``puppet master`` executables catch some signals for special
|
132
|
-
handling. Both daemons catch (``SIGHUP``), which forces the server to restart
|
133
|
-
tself. Predictably, interrupt and terminate (``SIGINT`` and ``SIGTERM``) will shut
|
134
|
-
down the server, whether it be an instance of ``puppet agent`` or ``puppet master``.
|
135
132
|
|
136
|
-
|
133
|
+
The `puppet agent` and `puppet master` executables catch some signals for special
|
134
|
+
handling. Both daemons catch (`SIGHUP`), which forces the server to restart
|
135
|
+
tself. Predictably, interrupt and terminate (`SIGINT` and `SIGTERM`) will shut
|
136
|
+
down the server, whether it be an instance of `puppet agent` or `puppet master`.
|
137
|
+
|
138
|
+
Sending the `SIGUSR1` signal to an instance of `puppet agent` will cause it to
|
137
139
|
immediately begin a new configuration transaction with the server. This
|
138
|
-
signal has no effect on
|
140
|
+
signal has no effect on `puppet master`.
|
139
141
|
|
140
142
|
Configuration Parameter Reference
|
141
143
|
---------------------------------
|
144
|
+
|
142
145
|
Below is a list of all documented parameters. Not all of them are valid with all
|
143
146
|
Puppet executables, but the executables will ignore any inappropriate values.
|
144
147
|
|