puppet 3.0.2 → 3.1.0.rc1
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/Gemfile +13 -11
- data/README.md +9 -7
- data/README_DEVELOPER.md +21 -30
- data/bin/extlookup2hiera +0 -0
- data/conf/auth.conf +42 -26
- data/conf/fileserver.conf +41 -0
- data/conf/tagmail.conf +16 -0
- data/examples/hiera/modules/data/manifests/common.pp +2 -1
- data/examples/hiera/modules/ntp/manifests/config.pp +4 -3
- data/examples/hiera/modules/ntp/manifests/data.pp +2 -1
- data/examples/hiera/modules/users/manifests/common.pp +2 -1
- data/examples/hiera/modules/users/manifests/dc1.pp +2 -1
- data/examples/hiera/modules/users/manifests/development.pp +2 -1
- data/examples/hiera/site.pp +1 -1
- data/ext/debian/fileserver.conf +39 -15
- data/ext/envpuppet +2 -0
- data/ext/gentoo/puppet/fileserver.conf +41 -12
- data/ext/ips/puppet-agent +1 -6
- data/ext/ips/puppetagent.xml +0 -4
- data/ext/osx/postflight.erb +109 -0
- data/ext/project_data.yaml +2 -2
- data/ext/redhat/fileserver.conf +41 -12
- data/ext/redhat/puppet.spec.erb +8 -13
- data/install.rb +2 -5
- data/lib/puppet.rb +30 -13
- data/lib/puppet/application.rb +34 -16
- data/lib/puppet/application/agent.rb +4 -4
- data/lib/puppet/application/master.rb +25 -5
- data/lib/puppet/defaults.rb +11 -7
- data/lib/puppet/dsl.rb +7 -3
- data/lib/puppet/dsl/actions.rb +283 -0
- data/lib/puppet/dsl/blank_slate.rb +55 -0
- data/lib/puppet/dsl/context.rb +393 -0
- data/lib/puppet/dsl/parser.rb +57 -0
- data/lib/puppet/dsl/resource_decorator.rb +56 -0
- data/lib/puppet/dsl/resource_reference.rb +95 -0
- data/lib/puppet/dsl/type_reference.rb +102 -0
- data/lib/puppet/error.rb +1 -1
- data/lib/puppet/face/help.rb +2 -4
- data/lib/puppet/face/man.rb +8 -2
- data/lib/puppet/feature/pson.rb +1 -3
- data/lib/puppet/indirector/catalog/active_record.rb +3 -0
- data/lib/puppet/indirector/catalog/compiler.rb +1 -2
- data/lib/puppet/indirector/catalog/queue.rb +4 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +30 -0
- data/lib/puppet/indirector/catalog/store_configs.rb +3 -0
- data/lib/puppet/indirector/certificate_request/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_revocation_list/rest.rb +1 -0
- data/lib/puppet/indirector/certificate_status/file.rb +4 -0
- data/lib/puppet/indirector/certificate_status/rest.rb +1 -0
- data/lib/puppet/indirector/facts/active_record.rb +3 -0
- data/lib/puppet/indirector/facts/couch.rb +3 -0
- data/lib/puppet/indirector/facts/inventory_active_record.rb +4 -0
- data/lib/puppet/indirector/facts/store_configs.rb +3 -0
- data/lib/puppet/indirector/file_metadata/rest.rb +2 -0
- data/lib/puppet/indirector/instrumentation_data/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_data/rest.rb +3 -0
- data/lib/puppet/indirector/instrumentation_listener/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_listener/rest.rb +3 -0
- data/lib/puppet/indirector/instrumentation_probe/local.rb +3 -0
- data/lib/puppet/indirector/instrumentation_probe/rest.rb +3 -0
- data/lib/puppet/indirector/node/active_record.rb +3 -0
- data/lib/puppet/indirector/node/rest.rb +2 -2
- data/lib/puppet/indirector/node/store_configs.rb +3 -0
- data/lib/puppet/indirector/node/write_only_yaml.rb +32 -0
- data/lib/puppet/indirector/queue.rb +0 -1
- data/lib/puppet/indirector/request.rb +1 -2
- data/lib/puppet/indirector/resource/active_record.rb +4 -0
- data/lib/puppet/indirector/resource/ral.rb +3 -0
- data/lib/puppet/indirector/resource/rest.rb +3 -0
- data/lib/puppet/indirector/resource/store_configs.rb +3 -0
- data/lib/puppet/indirector/run/local.rb +3 -0
- data/lib/puppet/indirector/ssl_file.rb +16 -14
- data/lib/puppet/indirector/status/local.rb +3 -0
- data/lib/puppet/indirector/status/rest.rb +4 -0
- data/lib/puppet/interface.rb +78 -3
- data/lib/puppet/interface/action.rb +39 -3
- data/lib/puppet/interface/action_builder.rb +74 -1
- data/lib/puppet/interface/action_manager.rb +33 -3
- data/lib/puppet/interface/documentation.rb +116 -5
- data/lib/puppet/interface/face_collection.rb +6 -7
- data/lib/puppet/interface/option.rb +10 -1
- data/lib/puppet/interface/option_builder.rb +29 -1
- data/lib/puppet/interface/option_manager.rb +21 -6
- data/lib/puppet/metatype/manager.rb +47 -9
- data/lib/puppet/module_tool.rb +0 -1
- data/lib/puppet/network/formats.rb +0 -2
- data/lib/puppet/node.rb +2 -3
- data/lib/puppet/node/environment.rb +14 -1
- data/lib/puppet/parameter.rb +309 -44
- data/lib/puppet/parameter/package_options.rb +5 -0
- data/lib/puppet/parameter/path.rb +26 -3
- data/lib/puppet/parameter/value.rb +30 -6
- data/lib/puppet/parameter/value_collection.rb +82 -20
- data/lib/puppet/parser.rb +3 -0
- data/lib/puppet/parser/ast/definition.rb +2 -5
- data/lib/puppet/parser/ast/hostclass.rb +2 -3
- data/lib/puppet/parser/ast/node.rb +2 -5
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/compiler.rb +10 -0
- data/lib/puppet/parser/functions.rb +111 -7
- data/lib/puppet/parser/functions/create_resources.rb +23 -2
- data/lib/puppet/parser/functions/defined.rb +1 -1
- data/lib/puppet/parser/functions/extlookup.rb +2 -1
- data/lib/puppet/parser/functions/fail.rb +1 -1
- data/lib/puppet/parser/functions/file.rb +1 -1
- data/lib/puppet/parser/functions/fqdn_rand.rb +1 -1
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/functions/hiera.rb +1 -1
- data/lib/puppet/parser/functions/hiera_array.rb +1 -1
- data/lib/puppet/parser/functions/hiera_hash.rb +1 -1
- data/lib/puppet/parser/functions/hiera_include.rb +1 -1
- data/lib/puppet/parser/functions/include.rb +1 -1
- data/lib/puppet/parser/functions/inline_template.rb +1 -1
- data/lib/puppet/parser/functions/md5.rb +1 -1
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +54 -57
- data/lib/puppet/parser/functions/require.rb +1 -0
- data/lib/puppet/parser/functions/search.rb +1 -1
- data/lib/puppet/parser/functions/sha1.rb +1 -1
- data/lib/puppet/parser/functions/shellquote.rb +1 -1
- data/lib/puppet/parser/functions/split.rb +1 -2
- data/lib/puppet/parser/functions/sprintf.rb +7 -10
- data/lib/puppet/parser/functions/tag.rb +1 -1
- data/lib/puppet/parser/functions/tagged.rb +1 -1
- data/lib/puppet/parser/functions/template.rb +1 -1
- data/lib/puppet/parser/functions/versioncmp.rb +1 -5
- data/lib/puppet/parser/parser_support.rb +11 -27
- data/lib/puppet/parser/scope.rb +48 -4
- data/lib/puppet/parser/type_loader.rb +31 -7
- data/lib/puppet/property.rb +304 -70
- data/lib/puppet/property/ensure.rb +14 -1
- data/lib/puppet/property/keyvalue.rb +17 -8
- data/lib/puppet/property/list.rb +3 -0
- data/lib/puppet/property/ordered_list.rb +7 -0
- data/lib/puppet/provider.rb +275 -53
- data/lib/puppet/provider/augeas/augeas.rb +17 -3
- data/lib/puppet/provider/confiner.rb +30 -1
- data/lib/puppet/provider/group/pw.rb +2 -2
- data/lib/puppet/provider/package/pip.rb +0 -1
- data/lib/puppet/provider/package/pkgin.rb +2 -0
- data/lib/puppet/provider/service/bsd.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +10 -6
- data/lib/puppet/provider/service/init.rb +1 -1
- data/lib/puppet/provider/service/service.rb +1 -1
- data/lib/puppet/provider/user/pw.rb +2 -2
- data/lib/puppet/provider/user/useradd.rb +2 -3
- data/lib/puppet/reference/configuration.rb +6 -0
- data/lib/puppet/reports.rb +44 -4
- data/lib/puppet/reports/tagmail.rb +1 -1
- data/lib/puppet/resource.rb +38 -25
- data/lib/puppet/resource/type.rb +14 -6
- data/lib/puppet/settings.rb +66 -142
- data/lib/puppet/settings/config_file.rb +99 -0
- data/lib/puppet/settings/file_setting.rb +92 -24
- data/lib/puppet/settings/value_translator.rb +15 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +2 -2
- data/lib/puppet/test/test_helper.rb +8 -3
- data/lib/puppet/transaction.rb +1 -2
- data/lib/puppet/transaction/report.rb +122 -13
- data/lib/puppet/type.rb +763 -150
- data/lib/puppet/type/augeas.rb +4 -0
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/group.rb +1 -1
- data/lib/puppet/type/file/mode.rb +2 -0
- data/lib/puppet/type/file/selcontext.rb +1 -0
- data/lib/puppet/type/group.rb +12 -0
- data/lib/puppet/type/mount.rb +2 -2
- data/lib/puppet/type/notify.rb +1 -1
- data/lib/puppet/type/router.rb +1 -1
- data/lib/puppet/type/service.rb +1 -0
- data/lib/puppet/type/ssh_authorized_key.rb +3 -1
- data/lib/puppet/type/user.rb +8 -1
- data/lib/puppet/util.rb +8 -0
- data/lib/puppet/util/autoload.rb +7 -10
- data/lib/puppet/util/classgen.rb +58 -33
- data/lib/puppet/util/command_line.rb +120 -77
- data/lib/puppet/util/constant_inflector.rb +2 -0
- data/lib/puppet/util/execution.rb +63 -33
- data/lib/puppet/util/filetype.rb +1 -1
- data/lib/puppet/util/manifest_filetype_helper.rb +22 -0
- data/lib/puppet/util/methodhelper.rb +19 -0
- data/lib/puppet/util/monkey_patches.rb +46 -0
- data/lib/puppet/util/plugins.rb +2 -2
- data/lib/puppet/util/provider_features.rb +24 -8
- data/lib/puppet/util/rubygems.rb +8 -1
- data/lib/puppet/util/zaml.rb +1 -1
- data/lib/puppet/version.rb +74 -3
- data/spec/integration/application/apply_spec.rb +1 -1
- data/spec/integration/defaults_spec.rb +1 -0
- data/spec/integration/dsl/classes_spec.rb +191 -0
- data/spec/integration/dsl/defaults_spec.rb +38 -0
- data/spec/integration/dsl/definitions_spec.rb +73 -0
- data/spec/integration/dsl/functions_spec.rb +95 -0
- data/spec/integration/dsl/nodes_spec.rb +96 -0
- data/spec/integration/dsl/params_spec.rb +146 -0
- data/spec/integration/dsl/relationships_spec.rb +46 -0
- data/spec/integration/dsl/resources_spec.rb +202 -0
- data/spec/integration/dsl/type_loading_spec.rb +64 -0
- data/spec/integration/indirector/catalog/queue_spec.rb +1 -1
- data/spec/integration/network/formats_spec.rb +32 -45
- data/spec/integration/parser/collector_spec.rb +105 -25
- data/spec/integration/parser/scope_spec.rb +64 -1
- data/spec/integration/resource/catalog_spec.rb +2 -4
- data/spec/integration/type/package_spec.rb +1 -1
- data/spec/lib/matchers/catalog.rb +50 -0
- data/spec/lib/puppet_spec/compiler.rb +11 -0
- data/spec/lib/puppet_spec/dsl.rb +29 -0
- data/spec/spec_helper.rb +17 -3
- data/spec/unit/application/agent_spec.rb +0 -1
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/face_base_spec.rb +11 -4
- data/spec/unit/application/indirection_base_spec.rb +4 -8
- data/spec/unit/application/kick_spec.rb +5 -2
- data/spec/unit/application/master_spec.rb +0 -6
- data/spec/unit/application_spec.rb +38 -14
- data/spec/unit/dsl/actions_spec.rb +402 -0
- data/spec/unit/dsl/blank_slate_spec.rb +27 -0
- data/spec/unit/dsl/context_spec.rb +678 -0
- data/spec/unit/dsl/parser_spec.rb +56 -0
- data/spec/unit/dsl/resource_decorator_spec.rb +94 -0
- data/spec/unit/dsl/resource_reference_spec.rb +150 -0
- data/spec/unit/dsl/type_reference_spec.rb +164 -0
- data/spec/unit/face/help_spec.rb +5 -7
- data/spec/unit/indirector/certificate_request/rest_spec.rb +4 -0
- data/spec/unit/indirector/certificate_revocation_list/rest_spec.rb +4 -0
- data/spec/unit/indirector/certificate_status/rest_spec.rb +4 -0
- data/spec/unit/indirector/file_metadata/rest_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +3 -1
- data/spec/unit/indirector/queue_spec.rb +1 -7
- data/spec/unit/indirector/ssl_file_spec.rb +66 -39
- data/spec/unit/module_spec.rb +1 -1
- data/spec/unit/network/authstore_spec.rb +22 -1
- data/spec/unit/network/formats_spec.rb +1 -1
- data/spec/unit/node/environment_spec.rb +13 -0
- data/spec/unit/parser/collector_spec.rb +1 -1
- data/spec/unit/parser/compiler_spec.rb +26 -0
- data/spec/unit/parser/functions/create_resources_spec.rb +12 -1
- data/spec/unit/parser/functions/extlookup_spec.rb +4 -4
- data/spec/unit/parser/functions/hiera_array_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_hash_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_include_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_spec.rb +1 -1
- data/spec/unit/parser/functions/regsubst_spec.rb +4 -4
- data/spec/unit/parser/functions/split_spec.rb +4 -4
- data/spec/unit/parser/functions/sprintf_spec.rb +2 -2
- data/spec/unit/parser/functions/versioncmp_spec.rb +4 -4
- data/spec/unit/parser/functions_spec.rb +51 -1
- data/spec/unit/parser/parser_spec.rb +0 -14
- data/spec/unit/parser/type_loader_spec.rb +15 -1
- data/spec/unit/provider/augeas/augeas_spec.rb +31 -0
- data/spec/unit/provider/package/apt_spec.rb +0 -2
- data/spec/unit/provider/package/pip_spec.rb +12 -2
- data/spec/unit/provider/service/freebsd_spec.rb +8 -0
- data/spec/unit/provider/service/gentoo_spec.rb +20 -20
- data/spec/unit/provider/service/openrc_spec.rb +20 -20
- data/spec/unit/provider/service/src_spec.rb +4 -4
- data/spec/unit/provider/service/systemd_spec.rb +0 -8
- data/spec/unit/provider/service/windows_spec.rb +1 -1
- data/spec/unit/provider/user/useradd_spec.rb +2 -9
- data/spec/unit/relationship_spec.rb +2 -2
- data/spec/unit/resource/catalog_spec.rb +2 -2
- data/spec/unit/resource/type_spec.rb +49 -25
- data/spec/unit/resource_spec.rb +34 -2
- data/spec/unit/settings/config_file_spec.rb +100 -0
- data/spec/unit/settings/file_setting_spec.rb +87 -84
- data/spec/unit/settings/value_translator_spec.rb +77 -0
- data/spec/unit/settings_spec.rb +96 -29
- data/spec/unit/type/file/ensure_spec.rb +75 -36
- data/spec/unit/type/file_spec.rb +0 -68
- data/spec/unit/type/group_spec.rb +10 -0
- data/spec/unit/util/autoload_spec.rb +6 -0
- data/spec/unit/util/command_line_spec.rb +54 -62
- data/spec/unit/util/manifest_filetype_helper_spec.rb +29 -0
- data/spec/unit/util/metric_spec.rb +0 -9
- data/spec/unit/util/posix_spec.rb +0 -4
- data/spec/unit/util/rdoc_spec.rb +0 -12
- data/spec/unit/util/zaml_spec.rb +188 -130
- data/spec/unit/version_spec.rb +42 -0
- metadata +123 -90
- data/README_HIERA.md +0 -148
- data/conf/epm.list +0 -8
- data/conf/namespaceauth.conf +0 -20
- data/conf/puppet-queue.conf +0 -10
- data/examples/allatonce +0 -13
- data/examples/assignments +0 -11
- data/examples/components +0 -73
- data/examples/etc/init.d/sleeper +0 -70
- data/examples/etc/otherfile +0 -0
- data/examples/etc/puppet/fileserver.conf +0 -13
- data/examples/etc/puppet/namespaceauth.conf +0 -20
- data/examples/etc/puppet/puppet.conf +0 -10
- data/examples/etc/puppet/tagmail.conf +0 -1
- data/examples/execs +0 -16
- data/examples/file.bl +0 -11
- data/examples/filedefaults +0 -10
- data/examples/fileparsing +0 -116
- data/examples/filerecursion +0 -15
- data/examples/functions +0 -3
- data/examples/groups +0 -7
- data/examples/head +0 -30
- data/examples/importing +0 -8
- data/examples/mac_dscl.pp +0 -28
- data/examples/mac_dscl_revert.pp +0 -26
- data/examples/mac_pkgdmg.pp +0 -7
- data/examples/modules/sample_module.pp +0 -10
- data/examples/modules/sample_module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -36
- data/examples/modules/sample_module/manifests/init.pp +0 -12
- data/examples/modules/sample_module/templates/sample.erb +0 -5
- data/examples/nodes +0 -20
- data/examples/one +0 -8
- data/examples/relationships +0 -34
- data/examples/selectors +0 -28
- data/examples/simpletests +0 -11
- data/examples/svncommit +0 -13
- data/lib/puppet/dsl/resource_api.rb +0 -120
- data/lib/puppet/dsl/resource_type_api.rb +0 -34
- data/spec/integration/parser/ruby_manifest_spec.rb +0 -127
- data/spec/unit/dsl/resource_api_spec.rb +0 -180
- data/spec/unit/dsl/resource_type_api_spec.rb +0 -53
data/ext/envpuppet
CHANGED
@@ -67,6 +67,7 @@ EO_HELP
|
|
67
67
|
fi
|
68
68
|
|
69
69
|
if test -d puppet -o -d facter; then
|
70
|
+
(
|
70
71
|
echo " WARNING!"
|
71
72
|
echo " Strange things happen if puppet or facter are in the"
|
72
73
|
echo " current working directory"
|
@@ -77,6 +78,7 @@ if test -d puppet -o -d facter; then
|
|
77
78
|
echo ""
|
78
79
|
echo "Sleeping 2 seconds."
|
79
80
|
echo ""
|
81
|
+
) 1>&2
|
80
82
|
sleep 2
|
81
83
|
fi
|
82
84
|
|
@@ -1,12 +1,41 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
1
|
+
# fileserver.conf
|
2
|
+
|
3
|
+
# Puppet automatically serves PLUGINS and FILES FROM MODULES: anything in
|
4
|
+
# <module name>/files/<file name> is available to authenticated nodes at
|
5
|
+
# puppet:///modules/<module name>/<file name>. You do not need to edit this
|
6
|
+
# file to enable this.
|
7
|
+
|
8
|
+
# MOUNT POINTS
|
9
|
+
|
10
|
+
# If you need to serve files from a directory that is NOT in a module,
|
11
|
+
# you must create a static mount point in this file:
|
12
|
+
#
|
13
|
+
# [extra_files]
|
14
|
+
# path /etc/puppet/files
|
15
|
+
# allow *
|
16
|
+
#
|
17
|
+
# In the example above, anything in /etc/puppet/files/<file name> would be
|
18
|
+
# available to authenticated nodes at puppet:///extra_files/<file name>.
|
19
|
+
#
|
20
|
+
# Mount points may also use three placeholders as part of their path:
|
21
|
+
#
|
22
|
+
# %H - The node's certname.
|
23
|
+
# %h - The portion of the node's certname before the first dot. (Usually the
|
24
|
+
# node's short hostname.)
|
25
|
+
# %d - The portion of the node's certname after the first dot. (Usually the
|
26
|
+
# node's domain name.)
|
27
|
+
|
28
|
+
# PERMISSIONS
|
29
|
+
|
30
|
+
# Every static mount point should have an `allow *` line; setting more
|
31
|
+
# granular permissions in this file is deprecated. Instead, you can
|
32
|
+
# control file access in auth.conf by controlling the
|
33
|
+
# /file_metadata/<mount point> and /file_content/<mount point> paths:
|
34
|
+
#
|
35
|
+
# path ~ ^/file_(metadata|content)/extra_files/
|
36
|
+
# auth yes
|
37
|
+
# allow /^(.+)\.example\.com$/
|
38
|
+
# allow_ip 192.168.100.0/24
|
39
|
+
#
|
40
|
+
# If added to auth.conf BEFORE the "path /file" rule, the rule above
|
41
|
+
# will add stricter restrictions to the extra_files mount point.
|
data/ext/ips/puppet-agent
CHANGED
@@ -1,7 +1,4 @@
|
|
1
1
|
#!/sbin/sh
|
2
|
-
# It needs the smf property puppet-agent/server to be set to where the server is.
|
3
|
-
# svccfg -s svc:/network/puppet/agent setprop server/name=asstring:localhost
|
4
|
-
|
5
2
|
|
6
3
|
. /lib/svc/share/smf_include.sh
|
7
4
|
|
@@ -11,12 +8,10 @@ typeset -r CONF_FILE=/etc/puppet/puppet.conf
|
|
11
8
|
[[ ! -f "${CONF_FILE}" ]] && exit $SMF_EXIT_ERR_CONFIG
|
12
9
|
|
13
10
|
typeset -r PUPPET=/usr/bin/puppet
|
14
|
-
typeset -r PUPPET_SERVER=$(svcprop -p server/name $SMF_FMRI)
|
15
|
-
[[ -z "${PUPPET_SERVER}" ]] && exit $SMF_EXIT_ERR_CONFIG
|
16
11
|
|
17
12
|
case "$1" in
|
18
13
|
start)
|
19
|
-
exec $PUPPET agent
|
14
|
+
exec $PUPPET agent
|
20
15
|
;;
|
21
16
|
|
22
17
|
stop)
|
data/ext/ips/puppetagent.xml
CHANGED
@@ -26,10 +26,6 @@
|
|
26
26
|
|
27
27
|
<exec_method type="method" name="stop" exec="/lib/svc/method/puppet-agent stop" timeout_seconds="60"/>
|
28
28
|
|
29
|
-
<property_group name='server' type='framework'>
|
30
|
-
<propval name='name' type='astring' value='puppet' />
|
31
|
-
</property_group>
|
32
|
-
|
33
29
|
<stability value="Evolving"/>
|
34
30
|
|
35
31
|
<template>
|
@@ -0,0 +1,109 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
#by doing the below, we are ensuring we are modifying the target system the package is being installed on,
|
4
|
+
#not the OS running the installer
|
5
|
+
declare -x dest_vol="${3}"
|
6
|
+
declare -x dscl="${dest_vol}/usr/bin/dscl"
|
7
|
+
declare -x dspath="${dest_vol}/var/db/dslocal/nodes/Default/"
|
8
|
+
declare -x scripts_dir="${1}/Contents/Resources/"
|
9
|
+
declare -x awk="/usr/bin/awk"
|
10
|
+
declare -x last_user_id='-1'
|
11
|
+
declare -x last_group_id='-1'
|
12
|
+
|
13
|
+
function idFree() {
|
14
|
+
declare -a idArray=("${!2}")
|
15
|
+
for inc in ${idArray[@]}
|
16
|
+
do
|
17
|
+
if [ $inc == $1 ]
|
18
|
+
then
|
19
|
+
return 1
|
20
|
+
fi
|
21
|
+
done
|
22
|
+
|
23
|
+
return 0
|
24
|
+
|
25
|
+
}
|
26
|
+
|
27
|
+
function create_puser () {
|
28
|
+
"${dscl}" -f "${dspath}" localonly -create /Local/Target/Users/puppet
|
29
|
+
"${dscl}" -f "${dspath}" localonly -create /Local/Target/Users/puppet UniqueID $1
|
30
|
+
"${dscl}" -f "${dspath}" localonly -create /Local/Target/Users/puppet PrimaryGroupID $2
|
31
|
+
}
|
32
|
+
|
33
|
+
function create_pgroup () {
|
34
|
+
"${dscl}" -f "${dspath}" localonly -create /Local/Target/Groups/puppet
|
35
|
+
"${dscl}" -f "${dspath}" localonly -create /Local/Target/Groups/puppet PrimaryGroupID $1
|
36
|
+
}
|
37
|
+
|
38
|
+
function scan_users () {
|
39
|
+
UniqueIDS=(`"${dscl}" -f "${dspath}" localonly list /Local/Target/Users UniqueID | $awk '{print $2}'`);
|
40
|
+
|
41
|
+
#first just check for UID 52
|
42
|
+
if idFree '52' UniqueIDS[@]
|
43
|
+
then
|
44
|
+
last_user_id='52'
|
45
|
+
else
|
46
|
+
for possibleUID in {450..495}
|
47
|
+
do
|
48
|
+
if idFree $possibleUID UniqueIDS[@]
|
49
|
+
then
|
50
|
+
last_user_id=$possibleUID
|
51
|
+
#echo $last_good_id
|
52
|
+
fi
|
53
|
+
done
|
54
|
+
fi
|
55
|
+
}
|
56
|
+
|
57
|
+
function scan_groups () {
|
58
|
+
GroupIDS=(`"${dscl}" -f "${dspath}" localonly list /Local/Target/Groups PrimaryGroupID | $awk '{print $2}'`);
|
59
|
+
#check for 52 for group, if it's free, take it, don't bother doing the big search
|
60
|
+
if idFree '52' GroupIDS[@]
|
61
|
+
then
|
62
|
+
last_group_id='52'
|
63
|
+
else
|
64
|
+
for groupID in {450..495}
|
65
|
+
do
|
66
|
+
if idFree $groupID GroupIDS[@]
|
67
|
+
then
|
68
|
+
last_group_id=$groupID
|
69
|
+
fi
|
70
|
+
done
|
71
|
+
fi
|
72
|
+
}
|
73
|
+
|
74
|
+
echo "looking for Puppet User"
|
75
|
+
"${dscl}" -f "${dspath}" localonly -read /Local/Target/Users/puppet
|
76
|
+
puser_exists=$?
|
77
|
+
echo "Looking for Puppet Group"
|
78
|
+
"${dscl}" -f "${dspath}" localonly -read /Local/Target/Groups/puppet
|
79
|
+
pgroup_exists=$?
|
80
|
+
# exit status 56 indicates user/group not found
|
81
|
+
# exit status 0 indicates user/group does exist
|
82
|
+
|
83
|
+
if [ $pgroup_exists == '0' ] && [ $puser_exists == '0' ]; then
|
84
|
+
#Puppet user and group already exist
|
85
|
+
echo "Puppet User / Group already exist, not adding anything"
|
86
|
+
#storing the existing UID/GID to set permissions for /var/lib/puppet and /etc/puppet/puppet.conf
|
87
|
+
last_group_id=`"${dscl}" -f "${dspath}" localonly -read /Local/Target/Groups/puppet PrimaryGroupID | awk '{print $2}'`
|
88
|
+
last_user_id=`"${dscl}" -f "${dspath}" localonly -read /Local/Target/Users/puppet UniqueID | awk '{print $2}'`
|
89
|
+
elif [ $pgroup_exists == '0' ] && [ $puser_exists == '56' ]; then
|
90
|
+
#puppet group exists, but user does not
|
91
|
+
last_group_id=`"${dscl}" -f "${dspath}" localonly -read /Local/Target/Groups/puppet PrimaryGroupID | awk '{print $2}'`
|
92
|
+
scan_users
|
93
|
+
echo "Creating Puppet User (uid: $last_user_id) in existing Puppet Group (gid: $last_group_id)"
|
94
|
+
create_puser $last_user_id $last_group_id
|
95
|
+
elif [ $pgroup_exists == '56' ] && [ $puser_exists == '0' ]; then
|
96
|
+
#puppet user exists, but group does not
|
97
|
+
last_user_id=`"${dscl}" -f "${dspath}" localonly -read /Local/Target/Users/puppet UniqueID | awk '{print $2}'`
|
98
|
+
scan_groups
|
99
|
+
echo "Creating Puppet Group (gid: $last_group_id), Puppet User exists (uid: $last_user_id)"
|
100
|
+
create_pgroup $last_group_id
|
101
|
+
elif [ $pgroup_exists == '56' ] && [ $puser_exists == '56' ]; then
|
102
|
+
scan_users
|
103
|
+
scan_groups
|
104
|
+
echo "Creating Puppet User (uid: $last_user_id) in new Puppet Group (gid: $last_group_id)"
|
105
|
+
create_pgroup $last_group_id
|
106
|
+
create_puser $last_user_id $last_group_id
|
107
|
+
else
|
108
|
+
echo "Something went wrong and user creation will need to be done manually"
|
109
|
+
fi
|
data/ext/project_data.yaml
CHANGED
@@ -15,8 +15,8 @@ gem_executables: 'puppet'
|
|
15
15
|
gem_default_executables: 'puppet'
|
16
16
|
gem_forge_project: 'puppet'
|
17
17
|
gem_runtime_dependencies:
|
18
|
-
facter: '~> 1.6
|
19
|
-
hiera: '~> 1.0
|
18
|
+
facter: '~> 1.6'
|
19
|
+
hiera: '~> 1.0'
|
20
20
|
gem_rdoc_options:
|
21
21
|
- --title
|
22
22
|
- "Puppet - Configuration Management"
|
data/ext/redhat/fileserver.conf
CHANGED
@@ -1,12 +1,41 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
1
|
+
# fileserver.conf
|
2
|
+
|
3
|
+
# Puppet automatically serves PLUGINS and FILES FROM MODULES: anything in
|
4
|
+
# <module name>/files/<file name> is available to authenticated nodes at
|
5
|
+
# puppet:///modules/<module name>/<file name>. You do not need to edit this
|
6
|
+
# file to enable this.
|
7
|
+
|
8
|
+
# MOUNT POINTS
|
9
|
+
|
10
|
+
# If you need to serve files from a directory that is NOT in a module,
|
11
|
+
# you must create a static mount point in this file:
|
12
|
+
#
|
13
|
+
# [extra_files]
|
14
|
+
# path /etc/puppet/files
|
15
|
+
# allow *
|
16
|
+
#
|
17
|
+
# In the example above, anything in /etc/puppet/files/<file name> would be
|
18
|
+
# available to authenticated nodes at puppet:///extra_files/<file name>.
|
19
|
+
#
|
20
|
+
# Mount points may also use three placeholders as part of their path:
|
21
|
+
#
|
22
|
+
# %H - The node's certname.
|
23
|
+
# %h - The portion of the node's certname before the first dot. (Usually the
|
24
|
+
# node's short hostname.)
|
25
|
+
# %d - The portion of the node's certname after the first dot. (Usually the
|
26
|
+
# node's domain name.)
|
27
|
+
|
28
|
+
# PERMISSIONS
|
29
|
+
|
30
|
+
# Every static mount point should have an `allow *` line; setting more
|
31
|
+
# granular permissions in this file is deprecated. Instead, you can
|
32
|
+
# control file access in auth.conf by controlling the
|
33
|
+
# /file_metadata/<mount point> and /file_content/<mount point> paths:
|
34
|
+
#
|
35
|
+
# path ~ ^/file_(metadata|content)/extra_files/
|
36
|
+
# auth yes
|
37
|
+
# allow /^(.+)\.example\.com$/
|
38
|
+
# allow_ip 192.168.100.0/24
|
39
|
+
#
|
40
|
+
# If added to auth.conf BEFORE the "path /file" rule, the rule above
|
41
|
+
# will add stricter restrictions to the extra_files mount point.
|
data/ext/redhat/puppet.spec.erb
CHANGED
@@ -97,22 +97,11 @@ patch -s -p1 < ext/redhat/rundir-perms.patch
|
|
97
97
|
|
98
98
|
|
99
99
|
%build
|
100
|
-
# Fix some rpmlint complaints
|
101
|
-
for f in mac_dscl.pp mac_dscl_revert.pp \
|
102
|
-
mac_pkgdmg.pp ; do
|
103
|
-
sed -i -e'1d' examples/$f
|
104
|
-
chmod a-x examples/$f
|
105
|
-
done
|
106
100
|
for f in external/nagios.rb relationship.rb; do
|
107
101
|
sed -i -e '1d' lib/puppet/$f
|
108
102
|
done
|
109
|
-
#chmod +x ext/puppetstoredconfigclean.rb
|
110
|
-
|
111
|
-
find examples/ -type f -empty | xargs rm
|
112
|
-
find examples/ -type f | xargs chmod a-x
|
113
103
|
|
114
|
-
|
115
|
-
mv conf/puppet-queue.conf examples/etc/puppet/
|
104
|
+
find examples/ -type f | xargs --no-run-if-empty chmod a-x
|
116
105
|
|
117
106
|
%install
|
118
107
|
rm -rf %{buildroot}
|
@@ -206,7 +195,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/%{name}/modules
|
|
206
195
|
# These need to be owned by puppet so the server can
|
207
196
|
# write to them
|
208
197
|
%attr(-, puppet, puppet) %{_localstatedir}/run/puppet
|
209
|
-
%attr(
|
198
|
+
%attr(0750, puppet, puppet) %{_localstatedir}/log/puppet
|
210
199
|
%attr(-, puppet, puppet) %{_localstatedir}/lib/puppet
|
211
200
|
%{_mandir}/man5/puppet.conf.5.gz
|
212
201
|
%{_mandir}/man8/puppet.8.gz
|
@@ -386,6 +375,12 @@ rm -rf %{buildroot}
|
|
386
375
|
* <%= Time.now.strftime("%a %b %d %Y") %> Puppet Labs Release <info@puppetlabs.com> - <%= @rpmversion %>-<%= @rpmrelease %>
|
387
376
|
- Build for <%= @version %>
|
388
377
|
|
378
|
+
* Tue Dec 18 2012 Matthaus Owens <matthaus@puppetlabs.com>
|
379
|
+
- Remove for loop on examples/ code which no longer exists. Add --no-run-if-empty to xargs invocations.
|
380
|
+
|
381
|
+
* Sat Dec 1 2012 Ryan Uber <ryuber@cisco.com>
|
382
|
+
- Fix for logdir perms regression (#17866)
|
383
|
+
|
389
384
|
* Wed Aug 29 2012 Moses Mendoza <moses@puppetlabs.com> - 3.0.0-0.1rc5
|
390
385
|
- Update for 3.0.0 rc5
|
391
386
|
|
data/install.rb
CHANGED
@@ -179,8 +179,6 @@ def prepare_installation
|
|
179
179
|
end
|
180
180
|
|
181
181
|
|
182
|
-
InstallOptions.tests = true
|
183
|
-
|
184
182
|
ARGV.options do |opts|
|
185
183
|
opts.banner = "Usage: #{File.basename($0)} [options]"
|
186
184
|
opts.separator ""
|
@@ -190,8 +188,9 @@ def prepare_installation
|
|
190
188
|
opts.on('--[no-]ri', 'Prevents the creation of RI output.', 'Default off on mswin32.') do |onri|
|
191
189
|
InstallOptions.ri = onri
|
192
190
|
end
|
193
|
-
opts.on('--[no-]tests', 'Prevents the execution of unit tests.', 'Default
|
191
|
+
opts.on('--[no-]tests', 'Prevents the execution of unit tests.', 'Default off.') do |ontest|
|
194
192
|
InstallOptions.tests = ontest
|
193
|
+
warn "The tests flag is no longer functional in Puppet and is deprecated as of Dec 19, 2012. It will be removed in a future version of Puppet."
|
195
194
|
end
|
196
195
|
opts.on('--[no-]configs', 'Prevents the installation of config files', 'Default off.') do |ontest|
|
197
196
|
InstallOptions.configs = ontest
|
@@ -217,13 +216,11 @@ def prepare_installation
|
|
217
216
|
opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick|
|
218
217
|
InstallOptions.rdoc = false
|
219
218
|
InstallOptions.ri = false
|
220
|
-
InstallOptions.tests = false
|
221
219
|
InstallOptions.configs = true
|
222
220
|
end
|
223
221
|
opts.on('--full', 'Performs a full installation. All', 'optional installation steps are run.') do |full|
|
224
222
|
InstallOptions.rdoc = true
|
225
223
|
InstallOptions.ri = true
|
226
|
-
InstallOptions.tests = true
|
227
224
|
InstallOptions.configs = true
|
228
225
|
end
|
229
226
|
opts.separator("")
|
data/lib/puppet.rb
CHANGED
@@ -9,6 +9,9 @@ require 'puppet/settings'
|
|
9
9
|
require 'puppet/util/feature'
|
10
10
|
require 'puppet/util/suidmanager'
|
11
11
|
require 'puppet/util/run_mode'
|
12
|
+
require 'puppet/external/pson/common'
|
13
|
+
require 'puppet/external/pson/version'
|
14
|
+
require 'puppet/external/pson/pure'
|
12
15
|
|
13
16
|
#------------------------------------------------------------
|
14
17
|
# the top-level module
|
@@ -18,6 +21,9 @@ require 'puppet/util/run_mode'
|
|
18
21
|
#
|
19
22
|
# it's also a place to find top-level commands like 'debug'
|
20
23
|
|
24
|
+
# The main Puppet class. Everything is contained here.
|
25
|
+
#
|
26
|
+
# @api public
|
21
27
|
module Puppet
|
22
28
|
class << self
|
23
29
|
include Puppet::Util
|
@@ -46,7 +52,11 @@ module Puppet
|
|
46
52
|
@@settings.define_settings(section, hash)
|
47
53
|
end
|
48
54
|
|
49
|
-
#
|
55
|
+
# Get the value for a setting
|
56
|
+
#
|
57
|
+
# @param [Symbol] param the setting to retrieve
|
58
|
+
#
|
59
|
+
# @api public
|
50
60
|
def self.[](param)
|
51
61
|
if param == :debug
|
52
62
|
return Puppet::Util::Log.level == :debug
|
@@ -102,31 +112,36 @@ module Puppet
|
|
102
112
|
end
|
103
113
|
|
104
114
|
# Parse the config file for this process.
|
115
|
+
# @deprecated Use {#initialize_settings}
|
105
116
|
def self.parse_config()
|
106
117
|
Puppet.deprecation_warning("Puppet.parse_config is deprecated; please use Faces API (which will handle settings and state management for you), or (less desirable) call Puppet.initialize_settings")
|
107
118
|
Puppet.initialize_settings
|
108
119
|
end
|
109
120
|
|
110
|
-
# Initialize puppet's settings.
|
111
|
-
# built off of the Faces API or the Puppet::Util::Application class.
|
121
|
+
# Initialize puppet's settings. This is intended only for use by external tools that are not
|
122
|
+
# built off of the Faces API or the Puppet::Util::Application class. It may also be used
|
112
123
|
# to initialize state so that a Face may be used programatically, rather than as a stand-alone
|
113
124
|
# command-line tool.
|
114
125
|
#
|
115
|
-
#
|
116
|
-
|
117
|
-
|
126
|
+
# @api public
|
127
|
+
# @param args [Array<String>] the command line arguments to use for initialization
|
128
|
+
# @return [void]
|
129
|
+
def self.initialize_settings(args = [])
|
130
|
+
do_initialize_settings_for_run_mode(:user, args)
|
118
131
|
end
|
119
132
|
|
120
|
-
# Initialize puppet's settings for a specified run_mode.
|
133
|
+
# Initialize puppet's settings for a specified run_mode.
|
134
|
+
#
|
135
|
+
# @deprecated Use {#initialize_settings}
|
121
136
|
def self.initialize_settings_for_run_mode(run_mode)
|
122
137
|
Puppet.deprecation_warning("initialize_settings_for_run_mode may be removed in a future release, as may run_mode itself")
|
123
|
-
do_initialize_settings_for_run_mode(run_mode)
|
138
|
+
do_initialize_settings_for_run_mode(run_mode, [])
|
124
139
|
end
|
125
140
|
|
126
141
|
# private helper method to provide the implementation details of initializing for a run mode,
|
127
142
|
# but allowing us to control where the deprecation warning is issued
|
128
|
-
def self.do_initialize_settings_for_run_mode(run_mode)
|
129
|
-
Puppet.settings.initialize_global_settings
|
143
|
+
def self.do_initialize_settings_for_run_mode(run_mode, args)
|
144
|
+
Puppet.settings.initialize_global_settings(args)
|
130
145
|
run_mode = Puppet::Util::RunMode[run_mode]
|
131
146
|
Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(run_mode))
|
132
147
|
end
|
@@ -140,9 +155,11 @@ module Puppet
|
|
140
155
|
end
|
141
156
|
end
|
142
157
|
|
143
|
-
# This feels weird to me; I would really like for us to get to a state where
|
144
|
-
#
|
145
|
-
#
|
158
|
+
# This feels weird to me; I would really like for us to get to a state where
|
159
|
+
# there is never a "require" statement anywhere besides the very top of a
|
160
|
+
# file. That would not be possible at the moment without a great deal of
|
161
|
+
# effort, but I think we should strive for it and revisit this at some point.
|
162
|
+
# --cprice 2012-03-16
|
146
163
|
|
147
164
|
require 'puppet/type'
|
148
165
|
require 'puppet/parser'
|