openvox 9.0.0.pre.alpha2 → 9.0.0.pre.beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +114 -1
- data/CODE_OF_CONDUCT.md +1 -1
- data/Gemfile +5 -5
- data/README.md +6 -6
- data/Rakefile +3 -3
- data/conf/environment.conf +2 -2
- data/conf/fileserver.conf +3 -3
- data/conf/puppet.conf +4 -4
- data/examples/enc/regexp_nodes/regexp_nodes.rb +2 -2
- data/examples/hiera/README.md +1 -1
- data/examples/nagios/check_puppet.rb +1 -1
- data/ext/README.md +3 -3
- data/ext/hiera/hiera.yaml +1 -1
- data/ext/project_data.yaml +1 -1
- data/ext/redhat/client.sysconfig +1 -0
- data/ext/solaris/smf/puppet.xml +2 -2
- data/ext/windows/puppet_interactive.bat +1 -1
- data/ext/windows/service/daemon.rb +5 -5
- data/lib/hiera/puppet_function.rb +1 -2
- data/lib/hiera_puppet.rb +1 -1
- data/lib/puppet/agent/disabler.rb +3 -3
- data/lib/puppet/agent/locker.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/application/agent.rb +33 -35
- data/lib/puppet/application/apply.rb +7 -7
- data/lib/puppet/application/describe.rb +3 -3
- data/lib/puppet/application/device.rb +1 -1
- data/lib/puppet/application/doc.rb +5 -7
- data/lib/puppet/application/facts.rb +1 -1
- data/lib/puppet/application/filebucket.rb +5 -5
- data/lib/puppet/application/lookup.rb +8 -8
- data/lib/puppet/application/resource.rb +5 -5
- data/lib/puppet/application/script.rb +3 -3
- data/lib/puppet/application/ssl.rb +4 -4
- data/lib/puppet/application_support.rb +2 -2
- data/lib/puppet/configurer.rb +13 -7
- data/lib/puppet/confine/variable.rb +2 -2
- data/lib/puppet/context.rb +1 -1
- data/lib/puppet/data_binding.rb +1 -1
- data/lib/puppet/defaults.rb +157 -226
- data/lib/puppet/error.rb +1 -1
- data/lib/puppet/etc.rb +4 -4
- data/lib/puppet/face/catalog/select.rb +3 -3
- data/lib/puppet/face/catalog.rb +4 -4
- data/lib/puppet/face/config.rb +6 -6
- data/lib/puppet/face/facts.rb +6 -6
- data/lib/puppet/face/help/man.erb +3 -3
- data/lib/puppet/face/node/clean.rb +3 -3
- data/lib/puppet/face/node.rb +2 -2
- data/lib/puppet/face/plugin.rb +4 -4
- data/lib/puppet/functions/all.rb +4 -4
- data/lib/puppet/functions/any.rb +4 -4
- data/lib/puppet/functions/assert_type.rb +5 -5
- data/lib/puppet/functions/defined.rb +1 -1
- data/lib/puppet/functions/each.rb +11 -11
- data/lib/puppet/functions/epp.rb +5 -5
- data/lib/puppet/functions/eyaml_lookup_key.rb +1 -1
- data/lib/puppet/functions/filter.rb +5 -5
- data/lib/puppet/functions/find_file.rb +1 -1
- data/lib/puppet/functions/hiera.rb +4 -4
- data/lib/puppet/functions/hiera_array.rb +5 -5
- data/lib/puppet/functions/hiera_hash.rb +5 -5
- data/lib/puppet/functions/hiera_include.rb +6 -6
- data/lib/puppet/functions/hocon_data.rb +1 -1
- data/lib/puppet/functions/include.rb +1 -1
- data/lib/puppet/functions/index.rb +3 -3
- data/lib/puppet/functions/inline_epp.rb +6 -6
- data/lib/puppet/functions/json_data.rb +1 -1
- data/lib/puppet/functions/lest.rb +1 -1
- data/lib/puppet/functions/lookup.rb +14 -14
- data/lib/puppet/functions/map.rb +5 -5
- data/lib/puppet/functions/reduce.rb +6 -6
- data/lib/puppet/functions/regsubst.rb +1 -13
- data/lib/puppet/functions/reverse_each.rb +5 -5
- data/lib/puppet/functions/scanf.rb +1 -1
- data/lib/puppet/functions/step.rb +5 -5
- data/lib/puppet/functions/then.rb +1 -1
- data/lib/puppet/functions/tree_each.rb +3 -3
- data/lib/puppet/functions/versioncmp.rb +1 -1
- data/lib/puppet/functions/with.rb +2 -2
- data/lib/puppet/functions/yaml_data.rb +1 -1
- data/lib/puppet/generate/type.rb +5 -1
- data/lib/puppet/gettext/config.rb +5 -5
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/simple_graph.rb +0 -1
- data/lib/puppet/http/client.rb +5 -5
- data/lib/puppet/http/factory.rb +1 -1
- data/lib/puppet/http/resolver/server_list.rb +2 -2
- data/lib/puppet/http/service/compiler.rb +3 -3
- data/lib/puppet/http/service/file_server.rb +1 -1
- data/lib/puppet/http/service.rb +19 -1
- data/lib/puppet/http/session.rb +1 -1
- data/lib/puppet/http.rb +1 -1
- data/lib/puppet/indirector/catalog/compiler.rb +2 -2
- data/lib/puppet/indirector/data_binding/hiera.rb +93 -2
- data/lib/puppet/indirector/face.rb +4 -4
- data/lib/puppet/indirector/facts/facter.rb +7 -7
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -2
- data/lib/puppet/indirector/file_bucket_file/rest.rb +7 -3
- data/lib/puppet/indirector/file_content/file_server.rb +1 -1
- data/lib/puppet/indirector/file_metadata/file_server.rb +1 -1
- data/lib/puppet/indirector/node/exec.rb +1 -1
- data/lib/puppet/indirector/node/rest.rb +1 -1
- data/lib/puppet/indirector/report/processor.rb +1 -1
- data/lib/puppet/indirector.rb +1 -1
- data/lib/puppet/interface/documentation.rb +1 -1
- data/lib/puppet/interface/face_collection.rb +1 -1
- data/lib/puppet/interface/option.rb +2 -2
- data/lib/puppet/module/task.rb +1 -1
- data/lib/puppet/module_tool/applications/application.rb +1 -1
- data/lib/puppet/module_tool/metadata.rb +1 -2
- data/lib/puppet/module_tool.rb +1 -1
- data/lib/puppet/network/authorization.rb +1 -1
- data/lib/puppet/network/http/api.rb +2 -2
- data/lib/puppet/network/http/connection.rb +2 -2
- data/lib/puppet/node/environment.rb +6 -6
- data/lib/puppet/node.rb +2 -2
- data/lib/puppet/pal/catalog_compiler.rb +1 -1
- data/lib/puppet/pal/pal_impl.rb +1 -25
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions/assert_type.rb +5 -5
- data/lib/puppet/parser/functions/create_resources.rb +1 -1
- data/lib/puppet/parser/functions/defined.rb +1 -1
- data/lib/puppet/parser/functions/digest.rb +1 -1
- data/lib/puppet/parser/functions/each.rb +11 -11
- data/lib/puppet/parser/functions/epp.rb +5 -5
- data/lib/puppet/parser/functions/filter.rb +5 -5
- data/lib/puppet/parser/functions/generate.rb +1 -1
- data/lib/puppet/parser/functions/hiera.rb +3 -3
- data/lib/puppet/parser/functions/hiera_array.rb +4 -4
- data/lib/puppet/parser/functions/hiera_hash.rb +4 -4
- data/lib/puppet/parser/functions/hiera_include.rb +5 -5
- data/lib/puppet/parser/functions/include.rb +1 -1
- data/lib/puppet/parser/functions/inline_epp.rb +6 -6
- data/lib/puppet/parser/functions/inline_template.rb +1 -1
- data/lib/puppet/parser/functions/lest.rb +1 -1
- data/lib/puppet/parser/functions/lookup.rb +14 -14
- data/lib/puppet/parser/functions/map.rb +5 -5
- data/lib/puppet/parser/functions/reduce.rb +7 -7
- data/lib/puppet/parser/functions/reverse_each.rb +5 -5
- data/lib/puppet/parser/functions/scanf.rb +1 -1
- data/lib/puppet/parser/functions/step.rb +5 -5
- data/lib/puppet/parser/functions/then.rb +1 -1
- data/lib/puppet/parser/functions/versioncmp.rb +1 -1
- data/lib/puppet/parser/functions/with.rb +1 -1
- data/lib/puppet/parser/functions.rb +3 -3
- data/lib/puppet/parser/scope.rb +1 -1
- data/lib/puppet/plugins/syntax_checkers.rb +2 -2
- data/lib/puppet/plugins.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/deferred_resolver.rb +4 -1
- data/lib/puppet/pops/issues.rb +3 -3
- data/lib/puppet/pops/loader/module_loaders.rb +4 -4
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +1 -1
- data/lib/puppet/pops/loaders.rb +4 -4
- data/lib/puppet/pops/lookup/lookup_adapter.rb +7 -66
- data/lib/puppet/pops/model/factory.rb +5 -5
- data/lib/puppet/pops/resource/resource_type_impl.rb +1 -1
- data/lib/puppet/pops/serialization/to_data_converter.rb +1 -1
- data/lib/puppet/pops/types/iterable.rb +1 -1
- data/lib/puppet/property/keyvalue.rb +3 -3
- data/lib/puppet/provider/group/aix.rb +2 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +2 -2
- data/lib/puppet/provider/package/aix.rb +1 -1
- data/lib/puppet/provider/package/apt.rb +2 -2
- data/lib/puppet/provider/package/aptitude.rb +0 -1
- data/lib/puppet/provider/package/dnfmodule.rb +1 -1
- data/lib/puppet/provider/package/nim.rb +1 -1
- data/lib/puppet/provider/package/pacman.rb +1 -2
- data/lib/puppet/provider/package/pip.rb +1 -1
- data/lib/puppet/provider/package/pip2.rb +1 -1
- data/lib/puppet/provider/package/pip3.rb +1 -1
- data/lib/puppet/provider/package/pkgdmg.rb +2 -2
- data/lib/puppet/provider/package/puppet_gem.rb +2 -2
- data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
- data/lib/puppet/provider/package/windows.rb +1 -1
- data/lib/puppet/provider/service/freebsd.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -5
- data/lib/puppet/provider/service/launchd.rb +2 -2
- data/lib/puppet/provider/service/smf.rb +1 -1
- data/lib/puppet/provider/service/upstart.rb +2 -2
- data/lib/puppet/provider/user/aix.rb +3 -3
- data/lib/puppet/provider/user/directoryservice.rb +9 -9
- data/lib/puppet/provider/user/pw.rb +3 -3
- data/lib/puppet/provider.rb +1 -1
- data/lib/puppet/reference/configuration.rb +6 -13
- data/lib/puppet/reference/function.rb +4 -4
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +3 -3
- data/lib/puppet/reference/providers.rb +3 -3
- data/lib/puppet/reference/report.rb +4 -4
- data/lib/puppet/reference/type.rb +2 -2
- data/lib/puppet/relationship.rb +1 -1
- data/lib/puppet/reports/http.rb +4 -4
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource/catalog.rb +4 -4
- data/lib/puppet/resource/type.rb +8 -8
- data/lib/puppet/settings/base_setting.rb +2 -3
- data/lib/puppet/settings/config_file.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +3 -11
- data/lib/puppet/settings.rb +11 -51
- data/lib/puppet/ssl/certificate.rb +4 -0
- data/lib/puppet/ssl/certificate_request.rb +1 -1
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/ssl/openssl_loader.rb +1 -1
- data/lib/puppet/ssl/ssl_provider.rb +5 -5
- data/lib/puppet/ssl/state_machine.rb +9 -3
- data/lib/puppet/syntax_checkers.rb +1 -1
- data/lib/puppet/transaction/report.rb +3 -3
- data/lib/puppet/transaction.rb +0 -1
- data/lib/puppet/type/exec.rb +20 -20
- data/lib/puppet/type/file/content.rb +10 -37
- data/lib/puppet/type/file/ensure.rb +18 -9
- data/lib/puppet/type/file/mode.rb +4 -4
- data/lib/puppet/type/file/selcontext.rb +2 -2
- data/lib/puppet/type/file/source.rb +19 -25
- data/lib/puppet/type/file.rb +22 -15
- data/lib/puppet/type/filebucket.rb +22 -8
- data/lib/puppet/type/group.rb +5 -5
- data/lib/puppet/type/notify.rb +1 -1
- data/lib/puppet/type/package.rb +4 -4
- data/lib/puppet/type/schedule.rb +11 -11
- data/lib/puppet/type/service.rb +8 -8
- data/lib/puppet/type/stage.rb +1 -1
- data/lib/puppet/type/user.rb +19 -21
- data/lib/puppet/type/whit.rb +2 -2
- data/lib/puppet/type.rb +27 -27
- data/lib/puppet/util/character_encoding.rb +3 -3
- data/lib/puppet/util/command_line.rb +1 -1
- data/lib/puppet/util/execution.rb +1 -1
- data/lib/puppet/util/filetype.rb +6 -6
- data/lib/puppet/util/log.rb +2 -2
- data/lib/puppet/util/logging.rb +3 -3
- data/lib/puppet/util/plist.rb +1 -1
- data/lib/puppet/util/profiler/around_profiler.rb +1 -1
- data/lib/puppet/util/profiler.rb +1 -1
- data/lib/puppet/util/rdoc.rb +6 -3
- data/lib/puppet/util/selinux.rb +5 -5
- data/lib/puppet/util/tag_set.rb +0 -1
- data/lib/puppet/util/windows/adsi.rb +1 -1
- data/lib/puppet/util/windows/com.rb +2 -2
- data/lib/puppet/util/windows/eventlog.rb +6 -6
- data/lib/puppet/util/windows/file.rb +2 -2
- data/lib/puppet/util/windows/security.rb +3 -3
- data/lib/puppet/util.rb +8 -3
- data/lib/puppet/version.rb +8 -8
- data/lib/puppet/x509/cert_provider.rb +1 -1
- data/lib/puppet.rb +5 -5
- data/locales/config.yaml +3 -3
- data/locales/puppet.pot +462 -464
- data/man/man5/puppet.conf.5 +122 -146
- data/man/man8/puppet-agent.8 +25 -25
- data/man/man8/puppet-apply.8 +6 -6
- data/man/man8/puppet-catalog.8 +11 -11
- data/man/man8/puppet-config.8 +7 -7
- data/man/man8/puppet-describe.8 +3 -3
- data/man/man8/puppet-device.8 +2 -2
- data/man/man8/puppet-doc.8 +5 -5
- data/man/man8/puppet-epp.8 +3 -3
- data/man/man8/puppet-facts.8 +11 -11
- data/man/man8/puppet-filebucket.8 +5 -5
- data/man/man8/puppet-generate.8 +3 -3
- data/man/man8/puppet-help.8 +3 -3
- data/man/man8/puppet-lookup.8 +8 -8
- data/man/man8/puppet-module.8 +7 -7
- data/man/man8/puppet-node.8 +11 -45
- data/man/man8/puppet-parser.8 +3 -3
- data/man/man8/puppet-plugin.8 +7 -7
- data/man/man8/puppet-report.8 +6 -6
- data/man/man8/puppet-resource.8 +5 -5
- data/man/man8/puppet-script.8 +3 -3
- data/man/man8/puppet-ssl.8 +21 -23
- data/man/man8/puppet.8 +2 -2
- metadata +5 -8
- data/lib/puppet/indirector/hiera.rb +0 -101
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +0 -902
- data/lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +0 -1068
|
@@ -31,7 +31,7 @@ require 'hiera/puppet_function'
|
|
|
31
31
|
#
|
|
32
32
|
# 1. A string key that Hiera searches for in the hierarchy. **Required**.
|
|
33
33
|
# 2. An optional default value to return if Hiera doesn't find anything matching the key.
|
|
34
|
-
# * If this argument isn't provided and this function results in a lookup failure,
|
|
34
|
+
# * If this argument isn't provided and this function results in a lookup failure, OpenVox
|
|
35
35
|
# fails with a compilation error.
|
|
36
36
|
# 3. The optional name of an arbitrary
|
|
37
37
|
# [hierarchy level](https://puppet.com/docs/hiera/latest/hierarchy.html) to insert at the
|
|
@@ -64,11 +64,11 @@ require 'hiera/puppet_function'
|
|
|
64
64
|
# # In site.pp, outside of any node definitions and below any top-scope variables:
|
|
65
65
|
# hiera_include('classes', undef)
|
|
66
66
|
#
|
|
67
|
-
# #
|
|
67
|
+
# # OpenVox assigns the apache and apache::mod::php classes to the web01.example.com node.
|
|
68
68
|
# ```
|
|
69
69
|
#
|
|
70
70
|
# You can optionally generate the default value with a
|
|
71
|
-
# [lambda](https://
|
|
71
|
+
# [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html) that
|
|
72
72
|
# takes one parameter.
|
|
73
73
|
#
|
|
74
74
|
# @example Using `hiera_include` with a lambda
|
|
@@ -79,15 +79,15 @@ require 'hiera/puppet_function'
|
|
|
79
79
|
# # In site.pp, outside of any node definitions and below any top-scope variables:
|
|
80
80
|
# hiera_include('classes') | $key | {"Key \'${key}\' not found" }
|
|
81
81
|
#
|
|
82
|
-
# #
|
|
82
|
+
# # OpenVox assigns the apache and apache::mod::php classes to the web01.example.com node.
|
|
83
83
|
# # If hiera_include couldn't match its key, it would return the lambda result,
|
|
84
84
|
# # "Key 'classes' not found".
|
|
85
85
|
# ```
|
|
86
86
|
#
|
|
87
87
|
# See
|
|
88
|
-
# [the 'Using the lookup function' documentation](https://
|
|
88
|
+
# [the 'Using the lookup function' documentation](https://docs.openvoxproject.org/openvox/latest/hiera_automatic.html) for how to perform lookup of data.
|
|
89
89
|
# Also see
|
|
90
|
-
# [the 'Using the deprecated hiera functions' documentation](https://
|
|
90
|
+
# [the 'Using the deprecated hiera functions' documentation](https://docs.openvoxproject.org/openvox/latest/hiera_automatic.html)
|
|
91
91
|
# for more information about the Hiera 3 functions.
|
|
92
92
|
#
|
|
93
93
|
# @since 4.0.0
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# The `hocon_data` is a hiera 5 `data_hash` data provider function.
|
|
4
|
-
# See [the configuration guide documentation](https://
|
|
4
|
+
# See [the configuration guide documentation](https://docs.openvoxproject.org/openvox/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for
|
|
5
5
|
# how to use this function.
|
|
6
6
|
#
|
|
7
7
|
# Note that this function is not supported without a hocon library being present.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
#
|
|
7
7
|
# The `include` function can be used multiple times on the same class and will
|
|
8
8
|
# only declare a given class once. If a class declared with `include` has any
|
|
9
|
-
# parameters,
|
|
9
|
+
# parameters, OpenVox will automatically look up values for them in Hiera, using
|
|
10
10
|
# `<class name>::<parameter name>` as the lookup key.
|
|
11
11
|
#
|
|
12
12
|
# Contrast this behavior with resource-like class declarations
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Returns the index (or key in a hash) to a first-found value in an `Iterable` value.
|
|
4
4
|
#
|
|
5
|
-
# When called with a [lambda](https://
|
|
5
|
+
# When called with a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
6
6
|
# the lambda is called repeatedly using each value in a data structure until the lambda returns a "truthy" value which
|
|
7
7
|
# makes the function return the index or key, or if the end of the iteration is reached, undef is returned.
|
|
8
8
|
#
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
# notice $data.index('workstations') # notices undef (not matching case)
|
|
86
86
|
# ```
|
|
87
87
|
#
|
|
88
|
-
# For an general examples that demonstrates iteration, see the
|
|
89
|
-
# [iteration](https://
|
|
88
|
+
# For an general examples that demonstrates iteration, see the OpenVox
|
|
89
|
+
# [iteration](https://docs.openvoxproject.org/openvox/latest/lang_iteration.html)
|
|
90
90
|
# documentation.
|
|
91
91
|
#
|
|
92
92
|
# @since 6.3.0
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
#
|
|
8
8
|
# The first argument to this function should be a string containing an EPP
|
|
9
9
|
# template. In most cases, the last argument is optional; if used, it should be a
|
|
10
|
-
# [hash](https://
|
|
10
|
+
# [hash](https://docs.openvoxproject.org/openvox/latest/lang_data_hash.html) that contains parameters to
|
|
11
11
|
# pass to the template.
|
|
12
12
|
#
|
|
13
|
-
# - See the [template](https://
|
|
13
|
+
# - See the [template](https://docs.openvoxproject.org/openvox/latest/lang_template.html)
|
|
14
14
|
# documentation for general template usage information.
|
|
15
|
-
# - See the [EPP syntax](https://
|
|
15
|
+
# - See the [EPP syntax](https://docs.openvoxproject.org/openvox/latest/lang_template_epp.html)
|
|
16
16
|
# documentation for examples of EPP.
|
|
17
17
|
#
|
|
18
18
|
# For example, to evaluate an inline EPP template and pass it the `docroot` and
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
# `inline_epp('docroot: <%= $docroot %> Virtual docroot: <%= $virtual_docroot %>',
|
|
22
22
|
# { 'docroot' => '/var/www/html', 'virtual_docroot' => '/var/www/example' })`
|
|
23
23
|
#
|
|
24
|
-
#
|
|
24
|
+
# OpenVox produces a syntax error if you pass more parameters than are declared in
|
|
25
25
|
# the template's parameter tag. When passing parameters to a template that
|
|
26
26
|
# contains a parameter tag, use the same names as the tag's declared parameters.
|
|
27
27
|
#
|
|
28
28
|
# Parameters are required only if they are declared in the called template's
|
|
29
|
-
# parameter tag without default values.
|
|
29
|
+
# parameter tag without default values. OpenVox produces an error if the
|
|
30
30
|
# `inline_epp` function fails to pass any required parameter.
|
|
31
31
|
#
|
|
32
32
|
# An inline EPP template should be written as a single-quoted string or
|
|
33
|
-
# [heredoc](https://
|
|
33
|
+
# [heredoc](https://docs.openvoxproject.org/openvox/latest/lang_data_string.html#heredocs).
|
|
34
34
|
# A double-quoted string is subject to expression interpolation before the string
|
|
35
35
|
# is parsed as an EPP template.
|
|
36
36
|
#
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# The `json_data` is a hiera 5 `data_hash` data provider function.
|
|
4
|
-
# See [the configuration guide documentation](https://
|
|
4
|
+
# See [the configuration guide documentation](https://docs.openvoxproject.org/openvox/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for
|
|
5
5
|
# how to use this function.
|
|
6
6
|
#
|
|
7
7
|
# @since 4.8.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Calls a [lambda](https://
|
|
3
|
+
# Calls a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# without arguments if the value given to `lest` is `undef`.
|
|
5
5
|
# Returns the result of calling the lambda if the argument is `undef`, otherwise the
|
|
6
6
|
# given argument.
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Uses the
|
|
3
|
+
# Uses the OpenVox lookup system to retrieve a value for a given key. By default,
|
|
4
4
|
# this returns the first value found (and fails compilation if no values are
|
|
5
5
|
# available), but you can configure it to merge multiple values into one, fail
|
|
6
6
|
# gracefully, and more.
|
|
7
7
|
#
|
|
8
|
-
# When looking up a key,
|
|
8
|
+
# When looking up a key, OpenVox will search up to three tiers of data, in the
|
|
9
9
|
# following order:
|
|
10
10
|
#
|
|
11
11
|
# 1. Hiera.
|
|
@@ -27,22 +27,22 @@
|
|
|
27
27
|
# The arguments accepted by `lookup` are as follows:
|
|
28
28
|
#
|
|
29
29
|
# 1. `<NAME>` (string or array) --- The name of the key to look up.
|
|
30
|
-
# * This can also be an array of keys. If
|
|
30
|
+
# * This can also be an array of keys. If OpenVox doesn't find anything for the
|
|
31
31
|
# first key, it will try again with the subsequent ones, only resorting to a
|
|
32
32
|
# default value if none of them succeed.
|
|
33
33
|
# 2. `<VALUE TYPE>` (data type) --- A
|
|
34
|
-
# [data type](https://
|
|
34
|
+
# [data type](https://docs.openvoxproject.org/openvox/latest/lang_data_type.html)
|
|
35
35
|
# that must match the retrieved value; if not, the lookup (and catalog
|
|
36
36
|
# compilation) will fail. Defaults to `Data` (accepts any normal value).
|
|
37
37
|
# 3. `<MERGE BEHAVIOR>` (string or hash; see **"Merge Behaviors"** below) ---
|
|
38
38
|
# Whether (and how) to combine multiple values. If present, this overrides any
|
|
39
|
-
# merge behavior specified in the data sources. Defaults to no value;
|
|
39
|
+
# merge behavior specified in the data sources. Defaults to no value; OpenVox will
|
|
40
40
|
# use merge behavior from the data sources if present, and will otherwise do a
|
|
41
41
|
# first-found lookup.
|
|
42
42
|
# 4. `<DEFAULT VALUE>` (any normal value) --- If present, `lookup` returns this
|
|
43
43
|
# when it can't find a normal value. Default values are never merged with found
|
|
44
44
|
# values. Like a normal value, the default must match the value type. Defaults to
|
|
45
|
-
# no value; if
|
|
45
|
+
# no value; if OpenVox can't find a normal value, the lookup (and compilation) will
|
|
46
46
|
# fail.
|
|
47
47
|
# 5. `<OPTIONS HASH>` (hash) --- Alternate way to set the arguments above, plus
|
|
48
48
|
# some less-common extra options. If you pass an options hash, you can't combine
|
|
@@ -54,24 +54,24 @@
|
|
|
54
54
|
# * `'merge'` --- Same as `<MERGE BEHAVIOR>` (argument 3).
|
|
55
55
|
# * `'default_value'` --- Same as `<DEFAULT VALUE>` (argument 4).
|
|
56
56
|
# * `'default_values_hash'` (hash) --- A hash of lookup keys and default
|
|
57
|
-
# values. If
|
|
57
|
+
# values. If OpenVox can't find a normal value, it will check this hash for the
|
|
58
58
|
# requested key before giving up. You can combine this with `default_value` or
|
|
59
59
|
# a lambda, which will be used if the key isn't present in this hash. Defaults
|
|
60
60
|
# to an empty hash.
|
|
61
|
-
# * `'override'` (hash) --- A hash of lookup keys and override values.
|
|
61
|
+
# * `'override'` (hash) --- A hash of lookup keys and override values. OpenVox
|
|
62
62
|
# will check for the requested key in the overrides hash _first;_ if found, it
|
|
63
63
|
# returns that value as the _final_ value, ignoring merge behavior. Defaults
|
|
64
64
|
# to an empty hash.
|
|
65
65
|
#
|
|
66
66
|
# Finally, `lookup` can take a lambda, which must accept a single parameter.
|
|
67
67
|
# This is yet another way to set a default value for the lookup; if no results are
|
|
68
|
-
# found,
|
|
68
|
+
# found, OpenVox will pass the requested key to the lambda and use its result as
|
|
69
69
|
# the default value.
|
|
70
70
|
#
|
|
71
71
|
# #### Merge Behaviors
|
|
72
72
|
#
|
|
73
|
-
#
|
|
74
|
-
# values in multiple sources. By default,
|
|
73
|
+
# OpenVox lookup uses a hierarchy of data sources, and a given key might have
|
|
74
|
+
# values in multiple sources. By default, OpenVox returns the first value it finds,
|
|
75
75
|
# but it can also continue searching and merge all the values together.
|
|
76
76
|
#
|
|
77
77
|
# > **Note:** Data sources can use the special `lookup_options` metadata key to
|
|
@@ -80,17 +80,17 @@
|
|
|
80
80
|
#
|
|
81
81
|
# The valid merge behaviors are:
|
|
82
82
|
#
|
|
83
|
-
# * `'first'` --- Returns the first value found, with no merging.
|
|
83
|
+
# * `'first'` --- Returns the first value found, with no merging. OpenVox lookup's
|
|
84
84
|
# default behavior.
|
|
85
85
|
# * `'unique'` (called "array merge" in classic Hiera) --- Combines any number of
|
|
86
86
|
# arrays and scalar values to return a merged, flattened array with all duplicate
|
|
87
87
|
# values removed. The lookup will fail if any hash values are found.
|
|
88
88
|
# * `'hash'` --- Combines the keys and values of any number of hashes to return a
|
|
89
|
-
# merged hash. If the same key exists in multiple source hashes,
|
|
89
|
+
# merged hash. If the same key exists in multiple source hashes, OpenVox will use
|
|
90
90
|
# the value from the highest-priority data source; it won't recursively merge the
|
|
91
91
|
# values.
|
|
92
92
|
# * `'deep'` --- Combines the keys and values of any number of hashes to return a
|
|
93
|
-
# merged hash. If the same key exists in multiple source hashes,
|
|
93
|
+
# merged hash. If the same key exists in multiple source hashes, OpenVox will
|
|
94
94
|
# recursively merge hash or array values (with duplicate values removed from
|
|
95
95
|
# arrays). For conflicting scalar values, the highest-priority value will win.
|
|
96
96
|
# * `{'strategy' => 'first'}`, `{'strategy' => 'unique'}`,
|
data/lib/puppet/functions/map.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Applies a [lambda](https://
|
|
3
|
+
# Applies a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# to every value in a data structure and returns an array containing the results.
|
|
5
5
|
#
|
|
6
6
|
# This function takes two mandatory arguments, in this order:
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
#
|
|
18
18
|
# `$transformed_data = map($data) |$parameter| { <PUPPET CODE BLOCK> }`
|
|
19
19
|
#
|
|
20
|
-
# When the first argument (`$data` in the above example) is an array,
|
|
20
|
+
# When the first argument (`$data` in the above example) is an array, OpenVox passes each
|
|
21
21
|
# value in turn to the lambda.
|
|
22
22
|
#
|
|
23
23
|
# @example Using the `map` function with an array and a one-parameter lambda
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
# # $transformed_data contains [10,20,30]
|
|
30
30
|
# ```
|
|
31
31
|
#
|
|
32
|
-
# When the first argument is a hash,
|
|
32
|
+
# When the first argument is a hash, OpenVox passes each key and value pair to the lambda
|
|
33
33
|
# as an array in the form `[key, value]`.
|
|
34
34
|
#
|
|
35
35
|
# @example Using the `map` function with a hash and a one-parameter lambda
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
# # $transformed_data contains ['a','b','c']
|
|
42
42
|
# ```
|
|
43
43
|
#
|
|
44
|
-
# When the first argument is an array and the lambda has two parameters,
|
|
44
|
+
# When the first argument is an array and the lambda has two parameters, OpenVox passes the
|
|
45
45
|
# array's indexes (enumerated from 0) in the first parameter and its values in the second
|
|
46
46
|
# parameter.
|
|
47
47
|
#
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
# # $transformed_data contains [0,1,2]
|
|
55
55
|
# ```
|
|
56
56
|
#
|
|
57
|
-
# When the first argument is a hash,
|
|
57
|
+
# When the first argument is a hash, OpenVox passes its keys to the first parameter and its
|
|
58
58
|
# values to the second parameter.
|
|
59
59
|
#
|
|
60
60
|
# @example Using the `map` function with a hash and a two-parameter lambda
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Applies a [lambda](https://
|
|
3
|
+
# Applies a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# to every value in a data structure from the first argument, carrying over the returned
|
|
5
5
|
# value of each iteration, and returns the result of the lambda's final iteration. This
|
|
6
6
|
# lets you create a new value or data structure by combining values from the first
|
|
@@ -31,16 +31,16 @@
|
|
|
31
31
|
#
|
|
32
32
|
# `reduce($data, start) |$memo, $value| { ... }`
|
|
33
33
|
#
|
|
34
|
-
# When the first argument (`$data` in the above example) is an array,
|
|
34
|
+
# When the first argument (`$data` in the above example) is an array, OpenVox passes each
|
|
35
35
|
# of the data structure's values in turn to the lambda's parameters. When the first
|
|
36
|
-
# argument is a hash,
|
|
36
|
+
# argument is a hash, OpenVox converts each of the hash's values to an array in the form
|
|
37
37
|
# `[key, value]`.
|
|
38
38
|
#
|
|
39
|
-
# If you pass a start memo value,
|
|
40
|
-
# and the data structure's first value. Otherwise,
|
|
39
|
+
# If you pass a start memo value, OpenVox executes the lambda with the provided memo value
|
|
40
|
+
# and the data structure's first value. Otherwise, OpenVox passes the structure's first two
|
|
41
41
|
# values to the lambda.
|
|
42
42
|
#
|
|
43
|
-
#
|
|
43
|
+
# OpenVox calls the lambda for each of the data structure's remaining values. For each
|
|
44
44
|
# call, it passes the result of the previous call as the first parameter (`$memo` in the
|
|
45
45
|
# above examples) and the next value from the data structure as the second parameter
|
|
46
46
|
# (`$value`).
|
|
@@ -19,11 +19,7 @@ Puppet::Functions.create_function(:regsubst) do
|
|
|
19
19
|
# - *I* Ignore case in regexps
|
|
20
20
|
# - *M* Multiline regexps
|
|
21
21
|
# - *G* Global replacement; all occurrences of the regexp in each target string will be replaced. Without this, only the first occurrence will be replaced.
|
|
22
|
-
# @param encoding [Enum['N','E','S','U']]
|
|
23
|
-
# Deprecated and ignored parameter, included only for compatibility.
|
|
24
22
|
# @return [Array[String], String] The result of the substitution. Result type is the same as for the target parameter.
|
|
25
|
-
# @deprecated
|
|
26
|
-
# This method has the optional encoding parameter, which is ignored.
|
|
27
23
|
# @example Get the third octet from the node's IP address:
|
|
28
24
|
# ```puppet
|
|
29
25
|
# $i3 = regsubst($ipaddress,'^(\\d+)\\.(\\d+)\\.(\\d+)\\.(\\d+)$','\\3')
|
|
@@ -33,7 +29,6 @@ Puppet::Functions.create_function(:regsubst) do
|
|
|
33
29
|
param 'String', :pattern
|
|
34
30
|
param 'Variant[String,Hash[String,String]]', :replacement
|
|
35
31
|
optional_param 'Optional[Pattern[/^[GEIM]*$/]]', :flags
|
|
36
|
-
optional_param "Enum['N','E','S','U']", :encoding
|
|
37
32
|
end
|
|
38
33
|
|
|
39
34
|
# @param target [String, Array[String]]
|
|
@@ -65,14 +60,7 @@ Puppet::Functions.create_function(:regsubst) do
|
|
|
65
60
|
optional_param 'Pattern[/^G?$/]', :flags
|
|
66
61
|
end
|
|
67
62
|
|
|
68
|
-
def regsubst_string(target, pattern, replacement, flags = nil
|
|
69
|
-
if encoding
|
|
70
|
-
Puppet.warn_once(
|
|
71
|
-
'deprecations', 'regsubst_function_encoding',
|
|
72
|
-
_("The regsubst() function's encoding argument has been ignored since Ruby 1.9 and will be removed in a future release")
|
|
73
|
-
)
|
|
74
|
-
end
|
|
75
|
-
|
|
63
|
+
def regsubst_string(target, pattern, replacement, flags = nil)
|
|
76
64
|
re_flags = 0
|
|
77
65
|
operation = :sub
|
|
78
66
|
unless flags.nil?
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Reverses the order of the elements of something that is iterable and optionally runs a
|
|
4
|
-
# [lambda](https://
|
|
4
|
+
# [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html) for each
|
|
5
5
|
# element.
|
|
6
6
|
#
|
|
7
7
|
# This function takes one to two arguments:
|
|
@@ -34,22 +34,22 @@
|
|
|
34
34
|
# $reverse_data = reverse_each($data)
|
|
35
35
|
# ```
|
|
36
36
|
#
|
|
37
|
-
# When no second argument is present,
|
|
37
|
+
# When no second argument is present, OpenVox returns an `Iterable` that represents the reverse
|
|
38
38
|
# order of its first argument. This allows methods on `Iterable` to be chained.
|
|
39
39
|
#
|
|
40
|
-
# When a lambda is given as the second argument,
|
|
40
|
+
# When a lambda is given as the second argument, OpenVox iterates the first argument in reverse
|
|
41
41
|
# order and passes each value in turn to the lambda, then returns `undef`.
|
|
42
42
|
#
|
|
43
43
|
# @example Using the `reverse_each` function with an array and a one-parameter lambda
|
|
44
44
|
#
|
|
45
45
|
# ```puppet
|
|
46
|
-
# #
|
|
46
|
+
# # OpenVox will log a notice for each of the three items
|
|
47
47
|
# # in $data in reverse order.
|
|
48
48
|
# $data = [1,2,3]
|
|
49
49
|
# $data.reverse_each |$item| { notice($item) }
|
|
50
50
|
# ```
|
|
51
51
|
#
|
|
52
|
-
# When no second argument is present,
|
|
52
|
+
# When no second argument is present, OpenVox returns a new `Iterable` which allows it to
|
|
53
53
|
# be directly chained into another function that takes an `Iterable` as an argument.
|
|
54
54
|
#
|
|
55
55
|
# @example Using the `reverse_each` function chained with a `map` function.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Scans a string and returns an array of one or more converted values based on the given format string.
|
|
4
4
|
# See the documentation of Ruby's String#scanf method for details about the supported formats (which
|
|
5
|
-
# are similar but not identical to the formats used in
|
|
5
|
+
# are similar but not identical to the formats used in OpenVox's `sprintf` function.)
|
|
6
6
|
#
|
|
7
7
|
# This function takes two mandatory arguments: the first is the string to convert, and the second is
|
|
8
8
|
# the format string. The result of the scan is an array, with each successfully scanned and transformed value.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# Provides stepping with given interval over elements in an iterable and optionally runs a
|
|
4
|
-
# [lambda](https://
|
|
4
|
+
# [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html) for each
|
|
5
5
|
# element.
|
|
6
6
|
#
|
|
7
7
|
# This function takes two to three arguments:
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
# $stepped_data = step($data, <n>)
|
|
36
36
|
# ```
|
|
37
37
|
#
|
|
38
|
-
# When no block is given,
|
|
38
|
+
# When no block is given, OpenVox returns an `Iterable` that yields the first element and every nth successor
|
|
39
39
|
# element, from its first argument. This allows functions on iterables to be chained.
|
|
40
|
-
# When a block is given,
|
|
40
|
+
# When a block is given, OpenVox iterates and calls the block with the first element and then with
|
|
41
41
|
# every nth successor element. It then returns `undef`.
|
|
42
42
|
#
|
|
43
43
|
# @example Using the `step` function with an array, a step factor, and a one-parameter block
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
# $data.step(3) |$item| {
|
|
49
49
|
# notice($item)
|
|
50
50
|
# }
|
|
51
|
-
# #
|
|
51
|
+
# # OpenVox notices the values '1', '4', '7'.
|
|
52
52
|
# ```
|
|
53
53
|
|
|
54
|
-
# When no block is given,
|
|
54
|
+
# When no block is given, OpenVox returns a new `Iterable` which allows it to be directly chained into
|
|
55
55
|
# another function that takes an `Iterable` as an argument.
|
|
56
56
|
#
|
|
57
57
|
# @example Using the `step` function chained with a `map` function.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Calls a [lambda](https://
|
|
3
|
+
# Calls a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# with the given argument unless the argument is `undef`.
|
|
5
5
|
# Returns `undef` if the argument is `undef`, and otherwise the result of giving the
|
|
6
6
|
# argument to the lambda.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Runs a [lambda](https://
|
|
3
|
+
# Runs a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# recursively and repeatedly using values from a data structure, then returns the unchanged data structure, or if
|
|
5
5
|
# a lambda is not given, returns an `Iterator` for the tree.
|
|
6
6
|
#
|
|
@@ -135,8 +135,8 @@
|
|
|
135
135
|
# further as each filtered result appears as a `Tuple` with `[path, value]`.
|
|
136
136
|
#
|
|
137
137
|
#
|
|
138
|
-
# For general examples that demonstrates iteration see the
|
|
139
|
-
# [iteration](https://
|
|
138
|
+
# For general examples that demonstrates iteration see the OpenVox
|
|
139
|
+
# [iteration](https://docs.openvoxproject.org/openvox/latest/lang_iteration.html)
|
|
140
140
|
# documentation.
|
|
141
141
|
#
|
|
142
142
|
# @since 5.0.0
|
|
@@ -25,7 +25,7 @@ require_relative '../../puppet/util/package'
|
|
|
25
25
|
# notice('2.6-1 is > than 2.4.5')
|
|
26
26
|
# }
|
|
27
27
|
#
|
|
28
|
-
# This function uses the same version comparison algorithm used by
|
|
28
|
+
# This function uses the same version comparison algorithm used by OpenVox's
|
|
29
29
|
# `package` type.
|
|
30
30
|
#
|
|
31
31
|
Puppet::Functions.create_function(:versioncmp) do
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Calls a [lambda](https://
|
|
3
|
+
# Calls a [lambda](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html)
|
|
4
4
|
# with the given arguments and returns the result.
|
|
5
5
|
#
|
|
6
6
|
# Since a lambda's scope is
|
|
7
|
-
# [local](https://
|
|
7
|
+
# [local](https://docs.openvoxproject.org/openvox/latest/lang_lambdas.html#lambda-scope)
|
|
8
8
|
# to the lambda, you can use the `with` function to create private blocks of code within a
|
|
9
9
|
# class using variables whose values cannot be accessed outside of the lambda.
|
|
10
10
|
#
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
require 'yaml'
|
|
4
4
|
|
|
5
5
|
# The `yaml_data` is a hiera 5 `data_hash` data provider function.
|
|
6
|
-
# See [the configuration guide documentation](https://
|
|
6
|
+
# See [the configuration guide documentation](https://docs.openvoxproject.org/openvox/latest/hiera_config_yaml_5.html#configuring-a-hierarchy-level-built-in-backends) for
|
|
7
7
|
# how to use this function.
|
|
8
8
|
#
|
|
9
9
|
# @since 4.8.0
|
data/lib/puppet/generate/type.rb
CHANGED
|
@@ -45,11 +45,14 @@ module Puppet
|
|
|
45
45
|
end
|
|
46
46
|
|
|
47
47
|
# Determines if the output file is up-to-date with respect to the input file.
|
|
48
|
+
# Generated files are stamped with their input's mtime, so the output is
|
|
49
|
+
# up-to-date only on an exact match; an input with older timestamps (e.g.
|
|
50
|
+
# a module downgrade) also triggers regeneration.
|
|
48
51
|
# @param [String, nil] The path to output to, or nil if determined by input
|
|
49
52
|
# @return [Boolean] Returns true if the output is up-to-date or false if not.
|
|
50
53
|
def up_to_date?(outputdir)
|
|
51
54
|
f = effective_output_path(outputdir)
|
|
52
|
-
Puppet::FileSystem.exist?(f) && (Puppet::FileSystem.stat(@path) <=> Puppet::FileSystem.stat(f))
|
|
55
|
+
Puppet::FileSystem.exist?(f) && (Puppet::FileSystem.stat(@path) <=> Puppet::FileSystem.stat(f)) == 0
|
|
53
56
|
end
|
|
54
57
|
|
|
55
58
|
# Gets the filename of the output file.
|
|
@@ -240,6 +243,7 @@ module Puppet
|
|
|
240
243
|
Puppet::FileSystem.open(effective_output_path, nil, 'w:UTF-8') do |file|
|
|
241
244
|
file.write(result)
|
|
242
245
|
end
|
|
246
|
+
Puppet::FileSystem.touch(effective_output_path, mtime: Puppet::FileSystem.stat(input.path).mtime)
|
|
243
247
|
rescue Exception => e
|
|
244
248
|
@bad_input = true
|
|
245
249
|
Puppet.log_exception(e, _("Failed to generate '%{effective_output_path}': %{message}") % { effective_output_path: effective_output_path, message: e.message })
|
|
@@ -79,7 +79,7 @@ module Puppet::GettextConfig
|
|
|
79
79
|
|
|
80
80
|
# @api private
|
|
81
81
|
# Resets the thread's configured text_domain to the default text domain.
|
|
82
|
-
# In
|
|
82
|
+
# In OpenVox Server, thread A may process a compile request that configures
|
|
83
83
|
# a domain, while thread B may invalidate that environment and delete the
|
|
84
84
|
# domain. That leaves thread A with an invalid text_domain selected.
|
|
85
85
|
# To avoid that, clear_text_domain after any processing that needs the
|
|
@@ -92,12 +92,12 @@ module Puppet::GettextConfig
|
|
|
92
92
|
|
|
93
93
|
# @api private
|
|
94
94
|
# Creates a default text domain containing the translations for
|
|
95
|
-
#
|
|
95
|
+
# OpenVox as the start of chain. When semantic_puppet gets initialized,
|
|
96
96
|
# its translations are added to this chain. This is used as a cache
|
|
97
97
|
# so that all non-module translations only need to be loaded once as
|
|
98
98
|
# we create and reset environment-specific text domains.
|
|
99
99
|
#
|
|
100
|
-
# @return true if
|
|
100
|
+
# @return true if OpenVox translations were successfully loaded, false
|
|
101
101
|
# otherwise
|
|
102
102
|
def self.create_default_text_domain
|
|
103
103
|
return if @gettext_disabled || !gettext_loaded?
|
|
@@ -169,10 +169,10 @@ module Puppet::GettextConfig
|
|
|
169
169
|
# @api private
|
|
170
170
|
# Adds translations from the default text domain to the specified
|
|
171
171
|
# text domain. Creates the default text domain if one does not exist
|
|
172
|
-
# (this will load
|
|
172
|
+
# (this will load OpenVox's translations).
|
|
173
173
|
#
|
|
174
174
|
# Since we are currently (Nov 2017) vendoring semantic_puppet, in normal
|
|
175
|
-
# flows these translations will be copied along with
|
|
175
|
+
# flows these translations will be copied along with OpenVox's.
|
|
176
176
|
#
|
|
177
177
|
# @param [Symbol] domain_name the name of the domain to add translations to
|
|
178
178
|
def self.copy_default_translations(domain_name)
|
|
@@ -26,7 +26,7 @@ module Puppet::ModuleTranslations
|
|
|
26
26
|
# @api private
|
|
27
27
|
# Loads translation files that have been pluginsync'd for modules
|
|
28
28
|
# from the $vardir.
|
|
29
|
-
# @param [String] vardir the path to
|
|
29
|
+
# @param [String] vardir the path to OpenVox's vardir
|
|
30
30
|
def self.load_from_vardir(vardir)
|
|
31
31
|
locale = Puppet::GettextConfig.current_locale
|
|
32
32
|
Dir.glob("#{vardir}/locales/#{locale}/*.po") do |f|
|
data/lib/puppet/http/client.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# The HTTP client provides methods for making `GET`, `POST`, etc requests to
|
|
4
|
-
# HTTP(S) servers. It also provides methods for resolving
|
|
4
|
+
# HTTP(S) servers. It also provides methods for resolving OpenVox Server REST
|
|
5
5
|
# service endpoints using SRV records and settings (such as `server_list`,
|
|
6
6
|
# `server`, `ca_server`, etc). Once a service endpoint has been resolved, there
|
|
7
7
|
# are methods for making REST requests (such as getting a node, sending facts,
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
# The client uses persistent HTTP connections by default unless the `Connection:
|
|
11
11
|
# close` header is specified and supports streaming response bodies.
|
|
12
12
|
#
|
|
13
|
-
# By default the client only trusts the
|
|
14
|
-
# if the `include_system_store` request option is set to true, then
|
|
15
|
-
# trust certificates in the
|
|
13
|
+
# By default the client only trusts the OpenVox CA for HTTPS connections. However,
|
|
14
|
+
# if the `include_system_store` request option is set to true, then OpenVox will
|
|
15
|
+
# trust certificates in the openvox-agent CA bundle.
|
|
16
16
|
#
|
|
17
17
|
# @example To access the HTTP client:
|
|
18
18
|
# client = Puppet.runtime[:http]
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
# @example To make an HTTP GET request:
|
|
21
21
|
# response = client.get(URI("http://www.example.com"))
|
|
22
22
|
#
|
|
23
|
-
# @example To make an HTTPS GET request, trusting the
|
|
23
|
+
# @example To make an HTTPS GET request, trusting the OpenVox CA and certs in OpenVox's CA bundle:
|
|
24
24
|
# response = client.get(URI("https://www.example.com"), options: { include_system_store: true })
|
|
25
25
|
#
|
|
26
26
|
# @example To use a URL containing special characters, such as spaces:
|
data/lib/puppet/http/factory.rb
CHANGED
|
@@ -7,7 +7,7 @@ require_relative '../../puppet/http'
|
|
|
7
7
|
# Factory for `Net::HTTP` objects.
|
|
8
8
|
#
|
|
9
9
|
# Encapsulates the logic for creating a `Net::HTTP` object based on the
|
|
10
|
-
# specified {Site} and
|
|
10
|
+
# specified {Site} and OpenVox settings.
|
|
11
11
|
#
|
|
12
12
|
# @api private
|
|
13
13
|
class Puppet::HTTP::Factory
|
|
@@ -62,11 +62,11 @@ class Puppet::HTTP::Resolver::ServerList < Puppet::HTTP::Resolver
|
|
|
62
62
|
return Puppet::HTTP::Service.create_service(@client, session, name, @resolved_url.host, @resolved_url.port)
|
|
63
63
|
rescue Puppet::HTTP::ResponseError => detail
|
|
64
64
|
if index < @server_list_setting.value.length - 1
|
|
65
|
-
Puppet.warning(_("
|
|
65
|
+
Puppet.warning(_("OpenVox server %{host}:%{port} is unavailable: %{code} %{reason}") %
|
|
66
66
|
{ host: service.url.host, port: service.url.port, code: detail.response.code, reason: detail.response.reason } +
|
|
67
67
|
' ' + _("Trying with next server from server_list."))
|
|
68
68
|
else
|
|
69
|
-
Puppet.log_exception(detail, _("
|
|
69
|
+
Puppet.log_exception(detail, _("OpenVox server %{host}:%{port} is unavailable: %{code} %{reason}") %
|
|
70
70
|
{ host: service.url.host, port: service.url.port, code: detail.response.code, reason: detail.response.reason })
|
|
71
71
|
end
|
|
72
72
|
rescue Puppet::HTTP::HTTPError => detail
|