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
|
@@ -138,11 +138,11 @@ class Puppet::HTTP::Service::Compiler < Puppet::HTTP::Service
|
|
|
138
138
|
# @param [String] certname The name of the node for which to compile the catalog.
|
|
139
139
|
# @param [Hash] persistent A hash containing two required keys, facts and catalog,
|
|
140
140
|
# which when set to true will cause the facts and reports to be stored in
|
|
141
|
-
#
|
|
141
|
+
# OpenVoxDB, or discarded if set to false.
|
|
142
142
|
# @param [String] environment The name of the environment for which to compile the catalog.
|
|
143
143
|
# @param [Hash] facts A hash with a required values key, containing a hash of all the
|
|
144
|
-
# facts for the node. If not provided,
|
|
145
|
-
# from
|
|
144
|
+
# facts for the node. If not provided, OpenVox will attempt to fetch facts for the node
|
|
145
|
+
# from OpenVoxDB.
|
|
146
146
|
# @param [Hash] trusted_facts A hash with a required values key containing a hash of
|
|
147
147
|
# the trusted facts for a node
|
|
148
148
|
# @param [String] transaction_uuid The id for tracking the catalog compilation and
|
|
@@ -78,7 +78,7 @@ class Puppet::HTTP::Service::FileServer < Puppet::HTTP::Service
|
|
|
78
78
|
# with `:recurselimit`. See the reference documentation for the file type
|
|
79
79
|
# for more details.
|
|
80
80
|
# @param [Integer] recurselimit When `recurse` is set, `recurselimit` defines
|
|
81
|
-
# how far
|
|
81
|
+
# how far OpenVox should descend into subdirectories. `0` is effectively the
|
|
82
82
|
# same as `recurse => false`, `1` will return files and directories directly
|
|
83
83
|
# inside the defined directory, `2` will return the direct content of the
|
|
84
84
|
# directory as well as the contents of the _first_ level of subdirectories.
|
data/lib/puppet/http/service.rb
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
# Represents an abstract
|
|
3
|
+
# Represents an abstract OpenVox web service.
|
|
4
4
|
#
|
|
5
5
|
# @abstract Subclass and implement methods for the service's REST APIs.
|
|
6
6
|
# @api public
|
|
@@ -32,6 +32,24 @@ class Puppet::HTTP::Service
|
|
|
32
32
|
#
|
|
33
33
|
# @api private
|
|
34
34
|
def self.create_service(client, session, name, server = nil, port = nil)
|
|
35
|
+
# this is the entry point for creating all services, check and issue warning here.
|
|
36
|
+
unless Puppet.settings.set_by_config? :server
|
|
37
|
+
if Puppet.features.root?
|
|
38
|
+
Puppet.deprecation_warning('OpenVox will not default to `server=puppet` as of version 9.0. Please update your configuration appropriately.')
|
|
39
|
+
else
|
|
40
|
+
Puppet.deprecation_warning('OpenVox no longer defaults to `server=puppet` when running as a non-privileged user. (Did you mean to run as root?)')
|
|
41
|
+
|
|
42
|
+
case name
|
|
43
|
+
when :ca
|
|
44
|
+
raise ArgumentError, 'Neither `server` nor `ca_server` is specified.' unless Puppet.settings.set_by_config? :ca_server
|
|
45
|
+
when :report
|
|
46
|
+
raise ArgumentError, 'Neither `server` nor `report_server` is specified.' unless Puppet.settings.set_by_config? :report_server
|
|
47
|
+
when :fileserver, :puppet, :puppetserver
|
|
48
|
+
raise ArgumentError, 'Required setting `server` is not specified.'
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
|
|
35
53
|
case name
|
|
36
54
|
when :ca
|
|
37
55
|
Puppet::HTTP::Service::Ca.new(client, session, server, port)
|
data/lib/puppet/http/session.rb
CHANGED
|
@@ -35,7 +35,7 @@ class Puppet::HTTP::Session
|
|
|
35
35
|
# port. Otherwise, we walk the list of resolvers in priority order:
|
|
36
36
|
# - DNS SRV
|
|
37
37
|
# - Server List
|
|
38
|
-
# -
|
|
38
|
+
# - OpenVox server/port settings
|
|
39
39
|
# If a given resolver fails to connect, it tries the next available resolver
|
|
40
40
|
# until a successful connection is found and returned. The successful service
|
|
41
41
|
# is cached and returned if `route_to` is called again.
|
data/lib/puppet/http.rb
CHANGED
|
@@ -11,7 +11,7 @@ require 'yaml'
|
|
|
11
11
|
require 'uri'
|
|
12
12
|
|
|
13
13
|
class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
14
|
-
desc "Compiles catalogs on demand using
|
|
14
|
+
desc "Compiles catalogs on demand using OpenVox's compiler."
|
|
15
15
|
|
|
16
16
|
include Puppet::Util
|
|
17
17
|
include Puppet::Util::Checksums
|
|
@@ -310,7 +310,7 @@ class Puppet::Resource::Catalog::Compiler < Puppet::Indirector::Code
|
|
|
310
310
|
if node.environment && node.environment.static_catalogs? && options[:static_catalog] && options[:code_id]
|
|
311
311
|
# Check for errors before compiling the catalog
|
|
312
312
|
checksum_type = common_checksum_type(options[:checksum_type])
|
|
313
|
-
raise Puppet::Error, _("Unable to find a common checksum type between agent '%{agent_type}' and
|
|
313
|
+
raise Puppet::Error, _("Unable to find a common checksum type between agent '%{agent_type}' and server '%{master_type}'.") % { agent_type: options[:checksum_type], master_type: known_checksum_types } unless checksum_type
|
|
314
314
|
end
|
|
315
315
|
|
|
316
316
|
escaped_node_name = node.name.gsub(/%/, '%%')
|
|
@@ -1,8 +1,99 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require_relative '../../../puppet/indirector/
|
|
3
|
+
require_relative '../../../puppet/indirector/code'
|
|
4
4
|
require 'hiera/scope'
|
|
5
5
|
|
|
6
|
-
class Puppet::DataBinding::Hiera < Puppet::Indirector::
|
|
6
|
+
class Puppet::DataBinding::Hiera < Puppet::Indirector::Code
|
|
7
7
|
desc "Retrieve data using Hiera."
|
|
8
|
+
|
|
9
|
+
def initialize(*args)
|
|
10
|
+
unless Puppet.features.hiera?
|
|
11
|
+
# TRANSLATORS "Hiera" is the name of a code library and should not be translated
|
|
12
|
+
raise _("Hiera terminus not supported without hiera library")
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
super
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
if defined?(::Psych::SyntaxError)
|
|
19
|
+
DATA_BINDING_EXCEPTIONS = [::StandardError, ::Psych::SyntaxError]
|
|
20
|
+
else
|
|
21
|
+
DATA_BINDING_EXCEPTIONS = [::StandardError]
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def find(request)
|
|
25
|
+
not_found = Object.new
|
|
26
|
+
options = request.options
|
|
27
|
+
Puppet.debug { "Performing a hiera indirector lookup of #{request.key} with options #{options.inspect}" }
|
|
28
|
+
value = hiera.lookup(request.key, not_found, Hiera::Scope.new(options[:variables]), nil, convert_merge(options[:merge]))
|
|
29
|
+
throw :no_such_key if value.equal?(not_found)
|
|
30
|
+
value
|
|
31
|
+
rescue *DATA_BINDING_EXCEPTIONS => detail
|
|
32
|
+
error = Puppet::DataBinding::LookupError.new("DataBinding 'hiera': #{detail.message}")
|
|
33
|
+
error.set_backtrace(detail.backtrace)
|
|
34
|
+
raise error
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
private
|
|
38
|
+
|
|
39
|
+
# Converts a lookup 'merge' parameter argument into a Hiera 'resolution_type' argument.
|
|
40
|
+
#
|
|
41
|
+
# @param merge [String,Hash,nil] The lookup 'merge' argument
|
|
42
|
+
# @return [Symbol,Hash,nil] The Hiera 'resolution_type'
|
|
43
|
+
def convert_merge(merge)
|
|
44
|
+
case merge
|
|
45
|
+
when nil, 'first'
|
|
46
|
+
# Nil is OK. Defaults to Hiera :priority
|
|
47
|
+
nil
|
|
48
|
+
when Puppet::Pops::MergeStrategy
|
|
49
|
+
convert_merge(merge.configuration)
|
|
50
|
+
when 'unique'
|
|
51
|
+
# Equivalent to Hiera :array
|
|
52
|
+
:array
|
|
53
|
+
when 'hash'
|
|
54
|
+
# Equivalent to Hiera :hash with default :native merge behavior. A Hash must be passed here
|
|
55
|
+
# to override possible Hiera deep merge config settings.
|
|
56
|
+
{ :behavior => :native }
|
|
57
|
+
when 'deep'
|
|
58
|
+
# Equivalent to Hiera :hash with :deeper merge behavior.
|
|
59
|
+
{ :behavior => :deeper }
|
|
60
|
+
when Hash
|
|
61
|
+
strategy = merge['strategy']
|
|
62
|
+
if strategy == 'deep'
|
|
63
|
+
result = { :behavior => :deeper }
|
|
64
|
+
# Remaining entries must have symbolic keys
|
|
65
|
+
merge.each_pair { |k, v| result[k.to_sym] = v unless k == 'strategy' }
|
|
66
|
+
result
|
|
67
|
+
else
|
|
68
|
+
convert_merge(strategy)
|
|
69
|
+
end
|
|
70
|
+
else
|
|
71
|
+
# TRANSLATORS "merge" is a parameter name and should not be translated
|
|
72
|
+
raise Puppet::DataBinding::LookupError, _("Unrecognized value for request 'merge' parameter: '%{merge}'") % { merge: merge }
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
public
|
|
77
|
+
|
|
78
|
+
def self.hiera_config
|
|
79
|
+
hiera_config = Puppet.settings[:hiera_config]
|
|
80
|
+
config = {}
|
|
81
|
+
|
|
82
|
+
if Puppet::FileSystem.exist?(hiera_config)
|
|
83
|
+
config = Hiera::Config.load(hiera_config)
|
|
84
|
+
else
|
|
85
|
+
Puppet.warning _("Config file %{hiera_config} not found, using Hiera defaults") % { hiera_config: hiera_config }
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
config[:logger] = 'puppet'
|
|
89
|
+
config
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def self.hiera
|
|
93
|
+
@hiera ||= Hiera.new(:config => hiera_config)
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
def hiera
|
|
97
|
+
self.class.hiera
|
|
98
|
+
end
|
|
8
99
|
end
|
|
@@ -6,16 +6,16 @@ class Puppet::Indirector::Face < Puppet::Face
|
|
|
6
6
|
option "--terminus _" + _("TERMINUS") do
|
|
7
7
|
summary _("The indirector terminus to use.")
|
|
8
8
|
description <<-EOT
|
|
9
|
-
Indirector faces expose indirected subsystems of
|
|
9
|
+
Indirector faces expose indirected subsystems of OpenVox. These
|
|
10
10
|
subsystems are each able to retrieve and alter a specific type of data
|
|
11
11
|
(with the familiar actions of `find`, `search`, `save`, and `destroy`)
|
|
12
|
-
from an arbitrary number of pluggable backends. In
|
|
12
|
+
from an arbitrary number of pluggable backends. In OpenVox parlance,
|
|
13
13
|
these backends are called terminuses.
|
|
14
14
|
|
|
15
15
|
Almost all indirected subsystems have a `rest` terminus that interacts
|
|
16
|
-
with the
|
|
16
|
+
with the OpenVox server's data. Most of them have additional terminuses
|
|
17
17
|
for various local data models, which are in turn used by the indirected
|
|
18
|
-
subsystem on the
|
|
18
|
+
subsystem on the OpenVox server whenever it receives a remote request.
|
|
19
19
|
|
|
20
20
|
The terminus for an action is often determined by context, but
|
|
21
21
|
occasionally needs to be set explicitly. See the "Notes" section of this
|
|
@@ -4,8 +4,8 @@ require_relative '../../../puppet/node/facts'
|
|
|
4
4
|
require_relative '../../../puppet/indirector/code'
|
|
5
5
|
|
|
6
6
|
class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
7
|
-
desc "Retrieve facts from
|
|
8
|
-
between
|
|
7
|
+
desc "Retrieve facts from OpenFact. This provides a somewhat abstract interface
|
|
8
|
+
between OpenVox and OpenFact. It's only `somewhat` abstract because it always
|
|
9
9
|
returns the local host's facts, regardless of what you attempt to find."
|
|
10
10
|
|
|
11
11
|
def allow_remote_requests?
|
|
@@ -13,25 +13,25 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def destroy(facts)
|
|
16
|
-
raise Puppet::DevError, _('You cannot destroy facts in the code store; it is only used for getting facts from
|
|
16
|
+
raise Puppet::DevError, _('You cannot destroy facts in the code store; it is only used for getting facts from OpenFact')
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
def save(facts)
|
|
20
|
-
raise Puppet::DevError, _('You cannot save facts to the code store; it is only used for getting facts from
|
|
20
|
+
raise Puppet::DevError, _('You cannot save facts to the code store; it is only used for getting facts from OpenFact')
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
# Lookup a host's facts up in
|
|
23
|
+
# Lookup a host's facts up in OpenFact.
|
|
24
24
|
def find(request)
|
|
25
25
|
Puppet.runtime[:facter].reset
|
|
26
26
|
|
|
27
|
-
# Note: we need to setup
|
|
27
|
+
# Note: we need to setup OpenVox's external search paths before adding the puppetversion
|
|
28
28
|
# fact. This is because in Facter 2.x, the first `Puppet.runtime[:facter].add` causes Facter to create
|
|
29
29
|
# its directory loaders which cannot be changed, meaning other external facts won't
|
|
30
30
|
# be resolved. (PUP-4607)
|
|
31
31
|
self.class.setup_external_search_paths(request)
|
|
32
32
|
self.class.setup_search_paths(request)
|
|
33
33
|
|
|
34
|
-
# Initialize core
|
|
34
|
+
# Initialize core OpenVox facts, such as puppetversion
|
|
35
35
|
Puppet.initialize_facts
|
|
36
36
|
|
|
37
37
|
result = if request.options[:resolve_options]
|
|
@@ -121,7 +121,7 @@ module Puppet::FileBucketFile
|
|
|
121
121
|
# @param files_original_path [String]
|
|
122
122
|
#
|
|
123
123
|
def matches(paths_file, files_original_path)
|
|
124
|
-
#
|
|
124
|
+
# OpenVox will have already written the paths_file in the systems encoding
|
|
125
125
|
# given its possible that request.options[:bucket_path] or Puppet[:bucketdir]
|
|
126
126
|
# contained characters in an encoding that are not represented the
|
|
127
127
|
# same way when the bytes are decoded as UTF-8, continue using system encoding
|
|
@@ -157,7 +157,7 @@ module Puppet::FileBucketFile
|
|
|
157
157
|
Puppet::FileSystem.dir_mkpath(paths_file)
|
|
158
158
|
end
|
|
159
159
|
|
|
160
|
-
#
|
|
160
|
+
# OpenVox will have already written the paths_file in the systems encoding
|
|
161
161
|
# given its possible that request.options[:bucket_path] or Puppet[:bucketdir]
|
|
162
162
|
# contained characters in an encoding that are not represented the
|
|
163
163
|
# same way when the bytes are decoded as UTF-8, continue using system encoding
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'uri'
|
|
3
4
|
require_relative '../../../puppet/indirector/rest'
|
|
4
5
|
require_relative '../../../puppet/file_bucket/file'
|
|
5
6
|
|
|
@@ -9,7 +10,8 @@ module Puppet::FileBucketFile
|
|
|
9
10
|
|
|
10
11
|
def head(request)
|
|
11
12
|
session = Puppet.lookup(:http_session)
|
|
12
|
-
|
|
13
|
+
url = URI::HTTPS.build(host: request.server, port: request.port) if request.server
|
|
14
|
+
api = session.route_to(:puppet, url: url)
|
|
13
15
|
api.head_filebucket_file(
|
|
14
16
|
request.key,
|
|
15
17
|
environment: request.environment.to_s,
|
|
@@ -23,7 +25,8 @@ module Puppet::FileBucketFile
|
|
|
23
25
|
|
|
24
26
|
def find(request)
|
|
25
27
|
session = Puppet.lookup(:http_session)
|
|
26
|
-
|
|
28
|
+
url = URI::HTTPS.build(host: request.server, port: request.port) if request.server
|
|
29
|
+
api = session.route_to(:puppet, url: url)
|
|
27
30
|
_, filebucket_file = api.get_filebucket_file(
|
|
28
31
|
request.key,
|
|
29
32
|
environment: request.environment.to_s,
|
|
@@ -40,7 +43,8 @@ module Puppet::FileBucketFile
|
|
|
40
43
|
|
|
41
44
|
def save(request)
|
|
42
45
|
session = Puppet.lookup(:http_session)
|
|
43
|
-
|
|
46
|
+
url = URI::HTTPS.build(host: request.server, port: request.port) if request.server
|
|
47
|
+
api = session.route_to(:puppet, url: url)
|
|
44
48
|
api.put_filebucket_file(
|
|
45
49
|
request.key,
|
|
46
50
|
body: request.instance.render,
|
|
@@ -5,5 +5,5 @@ require_relative '../../../puppet/indirector/file_content'
|
|
|
5
5
|
require_relative '../../../puppet/indirector/file_server'
|
|
6
6
|
|
|
7
7
|
class Puppet::Indirector::FileContent::FileServer < Puppet::Indirector::FileServer
|
|
8
|
-
desc "Retrieve file contents using
|
|
8
|
+
desc "Retrieve file contents using OpenVox's fileserver."
|
|
9
9
|
end
|
|
@@ -5,5 +5,5 @@ require_relative '../../../puppet/indirector/file_metadata'
|
|
|
5
5
|
require_relative '../../../puppet/indirector/file_server'
|
|
6
6
|
|
|
7
7
|
class Puppet::Indirector::FileMetadata::FileServer < Puppet::Indirector::FileServer
|
|
8
|
-
desc "Retrieve file metadata using
|
|
8
|
+
desc "Retrieve file metadata using OpenVox's fileserver."
|
|
9
9
|
end
|
|
@@ -5,7 +5,7 @@ require_relative '../../../puppet/indirector/exec'
|
|
|
5
5
|
|
|
6
6
|
class Puppet::Node::Exec < Puppet::Indirector::Exec
|
|
7
7
|
desc "Call an external program to get node information. See
|
|
8
|
-
the [External Nodes](https://
|
|
8
|
+
the [External Nodes](https://docs.openvoxproject.org/openvox/latest/lang_write_functions_in_puppet.html) page for more information."
|
|
9
9
|
include Puppet::Util
|
|
10
10
|
|
|
11
11
|
def command
|
|
@@ -4,7 +4,7 @@ require_relative '../../../puppet/node'
|
|
|
4
4
|
require_relative '../../../puppet/indirector/rest'
|
|
5
5
|
|
|
6
6
|
class Puppet::Node::Rest < Puppet::Indirector::REST
|
|
7
|
-
desc "Get a node via REST.
|
|
7
|
+
desc "Get a node via REST. OpenVox agent uses this to allow the OpenVox server
|
|
8
8
|
to override its environment."
|
|
9
9
|
|
|
10
10
|
def find(request)
|
|
@@ -5,7 +5,7 @@ require_relative '../../../puppet/indirector/code'
|
|
|
5
5
|
require_relative '../../../puppet/reports'
|
|
6
6
|
|
|
7
7
|
class Puppet::Transaction::Report::Processor < Puppet::Indirector::Code
|
|
8
|
-
desc "
|
|
8
|
+
desc "OpenVox's report processor. Processes the report with each of
|
|
9
9
|
the report types listed in the 'reports' setting."
|
|
10
10
|
|
|
11
11
|
def initialize
|
data/lib/puppet/indirector.rb
CHANGED
|
@@ -32,7 +32,7 @@ module Puppet::Indirector
|
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
# Declare that the including class indirects its methods to
|
|
35
|
-
# this terminus. The terminus name must be the name of
|
|
35
|
+
# this terminus. The terminus name must be the name of an OpenVox
|
|
36
36
|
# default, not the value -- if it's the value, then it gets
|
|
37
37
|
# evaluated at parse time, which is before the user has had a chance
|
|
38
38
|
# to override it.
|
|
@@ -58,7 +58,7 @@ class Puppet::Interface
|
|
|
58
58
|
# @dsl Faces
|
|
59
59
|
attr_doc :summary do |value|
|
|
60
60
|
value =~ /\n/ and
|
|
61
|
-
# TRANSLATORS 'Face' refers to a programming API in
|
|
61
|
+
# TRANSLATORS 'Face' refers to a programming API in OpenVox, 'summary' and 'description' are specifc attribute names and should not be translated
|
|
62
62
|
raise ArgumentError, _("Face summary should be a single line; put the long text in 'description' instead.")
|
|
63
63
|
value
|
|
64
64
|
end
|
|
@@ -131,7 +131,7 @@ module Puppet::Interface::FaceCollection
|
|
|
131
131
|
|
|
132
132
|
def self.underscorize(name)
|
|
133
133
|
unless name.to_s =~ /^[-_a-z][-_a-z0-9]*$/i then
|
|
134
|
-
# TRANSLATORS 'face' refers to a programming API in
|
|
134
|
+
# TRANSLATORS 'face' refers to a programming API in OpenVox
|
|
135
135
|
raise ArgumentError, _("%{name} (%{class_name}) is not a valid face name") %
|
|
136
136
|
{ name: name.inspect, class_name: name.class }
|
|
137
137
|
end
|
|
@@ -29,14 +29,14 @@ class Puppet::Interface::Option
|
|
|
29
29
|
# for our duplicate checking purpose, we don't make a check with the
|
|
30
30
|
# translated '-' -> '_'. Right now, we do that on purpose because of
|
|
31
31
|
# a duplicated option made publicly available on certificate and ca
|
|
32
|
-
# faces for dns alt names.
|
|
32
|
+
# faces for dns alt names. OpenVox defines 'dns_alt_names', those
|
|
33
33
|
# faces include 'dns-alt-names'. We can't get rid of 'dns-alt-names'
|
|
34
34
|
# yet, so we need to do our duplicate checking on the untranslated
|
|
35
35
|
# version of the option.
|
|
36
36
|
# jeffweiss 17 april 2012
|
|
37
37
|
name = optparse_to_optionname(item)
|
|
38
38
|
if Puppet.settings.include? name then
|
|
39
|
-
raise ArgumentError, _("%{option}: already defined in
|
|
39
|
+
raise ArgumentError, _("%{option}: already defined in OpenVox") % { option: item.inspect }
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
dup = dups[name]
|
data/lib/puppet/module/task.rb
CHANGED
|
@@ -117,7 +117,7 @@ class Puppet::Module
|
|
|
117
117
|
end
|
|
118
118
|
|
|
119
119
|
unless MOUNTS.include? mount
|
|
120
|
-
msg = _("Files must be saved in module directories that
|
|
120
|
+
msg = _("Files must be saved in module directories that OpenVox makes available via mount points: %{mounts}" %
|
|
121
121
|
{ mounts: MOUNTS.join(', ') })
|
|
122
122
|
raise InvalidMetadata.new(msg, 'puppet.tasks/invalid-metadata')
|
|
123
123
|
end
|
|
@@ -47,7 +47,7 @@ module Puppet::ModuleTool
|
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
if require_metadata && !Puppet::ModuleTool.is_module_root?(@path)
|
|
50
|
-
raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://
|
|
50
|
+
raise ArgumentError, _("Unable to find metadata.json in module root at %{path} See https://docs.openvoxproject.org/openvox/latest/modules_publishing.html for required file format.") % { path: @path }
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
metadata_path = File.join(@path, 'metadata.json')
|
|
@@ -4,7 +4,6 @@ require_relative '../../puppet/module_tool'
|
|
|
4
4
|
require_relative '../../puppet/network/format_support'
|
|
5
5
|
require 'uri'
|
|
6
6
|
require_relative '../../puppet/util/json'
|
|
7
|
-
require 'set'
|
|
8
7
|
|
|
9
8
|
module Puppet::ModuleTool
|
|
10
9
|
# This class provides a data structure representing a module's metadata.
|
|
@@ -89,7 +88,7 @@ module Puppet::ModuleTool
|
|
|
89
88
|
@data['dependencies'].to_a
|
|
90
89
|
end
|
|
91
90
|
|
|
92
|
-
# Returns a hash of the module's metadata. Used by
|
|
91
|
+
# Returns a hash of the module's metadata. Used by OpenVox's automated
|
|
93
92
|
# serialization routines.
|
|
94
93
|
#
|
|
95
94
|
# @see Puppet::Network::FormatSupport#to_data_hash
|
data/lib/puppet/module_tool.rb
CHANGED
|
@@ -140,7 +140,7 @@ module Puppet
|
|
|
140
140
|
#
|
|
141
141
|
# Generally speaking, the `:modulepath` parameter should supersede all
|
|
142
142
|
# others, the `:environment` parameter should follow after that, and we
|
|
143
|
-
# should default to
|
|
143
|
+
# should default to OpenVox's current environment.
|
|
144
144
|
#
|
|
145
145
|
# @param options [{Symbol => Object}] the options to derive environment from
|
|
146
146
|
# @return [Puppet::Node::Environment] the environment described by the options
|
|
@@ -8,7 +8,7 @@ module Puppet::Network
|
|
|
8
8
|
@authconfigloader_class = klass
|
|
9
9
|
end
|
|
10
10
|
|
|
11
|
-
# Verify something external to
|
|
11
|
+
# Verify something external to OpenVox is authorizing REST requests, so
|
|
12
12
|
# we don't fail insecurely due to misconfiguration.
|
|
13
13
|
def check_external_authorization(method, path)
|
|
14
14
|
if @authconfigloader_class.nil?
|
|
@@ -15,13 +15,13 @@ class Puppet::Network::HTTP::API
|
|
|
15
15
|
Puppet::Network::HTTP::Route
|
|
16
16
|
.path(/.*/)
|
|
17
17
|
.any(lambda do |_req, _res|
|
|
18
|
-
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL -
|
|
18
|
+
raise Puppet::Network::HTTP::Error::HTTPNotFoundError.new("Error: Invalid URL - OpenVox expects requests that conform to the " \
|
|
19
19
|
"/puppet and /puppet-ca APIs.\n\n" \
|
|
20
20
|
"Note that Puppet 3 agents aren't compatible with this version; if you're " \
|
|
21
21
|
"running Puppet 3, you must either upgrade your agents to match the server " \
|
|
22
22
|
"or point them to a server running Puppet 3.\n\n" \
|
|
23
23
|
"Server Info:\n" \
|
|
24
|
-
"
|
|
24
|
+
" OpenVox version: #{Puppet.version}\n" \
|
|
25
25
|
" Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}\n",
|
|
26
26
|
Puppet::Network::HTTP::Issues::HANDLER_NOT_FOUND)
|
|
27
27
|
end)
|
|
@@ -10,7 +10,7 @@ class Puppet::Network::HTTP::RedirectionLimitExceededException < Puppet::Error;
|
|
|
10
10
|
# object, but it provides a few important bits of additional
|
|
11
11
|
# functionality. Notably:
|
|
12
12
|
#
|
|
13
|
-
# * Any HTTPS requests made using this class will use
|
|
13
|
+
# * Any HTTPS requests made using this class will use OpenVox's SSL
|
|
14
14
|
# certificate configuration for their authentication, and
|
|
15
15
|
# * Provides some useful error handling for any SSL errors that occur
|
|
16
16
|
# during a request.
|
|
@@ -88,7 +88,7 @@ class Puppet::Network::HTTP::Connection
|
|
|
88
88
|
# be thrown.
|
|
89
89
|
# @option options [Hash{Symbol => String}] :basic_auth The basic auth
|
|
90
90
|
# :username and :password to use for the request, :metric_id Ignored
|
|
91
|
-
# by this class - used by
|
|
91
|
+
# by this class - used by OpenVox Server only. The metric id by which
|
|
92
92
|
# to track metrics on requests.
|
|
93
93
|
|
|
94
94
|
# @param path [String]
|
|
@@ -206,10 +206,10 @@ class Puppet::Node::Environment
|
|
|
206
206
|
end
|
|
207
207
|
|
|
208
208
|
# Checks to make sure that this environment did not have a manifest set in
|
|
209
|
-
# its original environment.conf if
|
|
209
|
+
# its original environment.conf if OpenVox is configured with
|
|
210
210
|
# +disable_per_environment_manifest+ set true. If it did, the environment's
|
|
211
211
|
# modules may not function as intended by the original authors, and we may
|
|
212
|
-
# seek to halt
|
|
212
|
+
# seek to halt an OpenVox compilation for a node in this environment.
|
|
213
213
|
#
|
|
214
214
|
# The only exception to this would be if the environment.conf manifest is an exact,
|
|
215
215
|
# uninterpolated match for the current +default_manifest+ setting.
|
|
@@ -272,7 +272,7 @@ class Puppet::Node::Environment
|
|
|
272
272
|
@rich_data = rich_data_from_env_conf.nil? ? Puppet[:rich_data] : rich_data_from_env_conf
|
|
273
273
|
end
|
|
274
274
|
|
|
275
|
-
# Return an environment-specific
|
|
275
|
+
# Return an environment-specific OpenVox setting.
|
|
276
276
|
#
|
|
277
277
|
# @api public
|
|
278
278
|
#
|
|
@@ -571,11 +571,11 @@ class Puppet::Node::Environment
|
|
|
571
571
|
#
|
|
572
572
|
# There are two sources that can be used for the initial parse:
|
|
573
573
|
#
|
|
574
|
-
# 1. The value of `Puppet[:code]`:
|
|
574
|
+
# 1. The value of `Puppet[:code]`: OpenVox can take a string from
|
|
575
575
|
# its settings and parse that as a manifest. This is used by various
|
|
576
|
-
#
|
|
576
|
+
# OpenVox applications to read in a manifest and pass it to the
|
|
577
577
|
# environment as a side effect. This is attempted first.
|
|
578
|
-
# 2. The contents of this environment's +manifest+ attribute:
|
|
578
|
+
# 2. The contents of this environment's +manifest+ attribute: OpenVox will
|
|
579
579
|
# try to load the environment manifest.
|
|
580
580
|
#
|
|
581
581
|
# @return [Puppet::Parser::AST::Hostclass] The AST hostclass object
|
data/lib/puppet/node.rb
CHANGED
|
@@ -208,7 +208,7 @@ class Puppet::Node
|
|
|
208
208
|
#
|
|
209
209
|
def sanitize
|
|
210
210
|
# Resurrect "trusted information" that comes from node/fact terminus.
|
|
211
|
-
# The current way this is done in
|
|
211
|
+
# The current way this is done in OpenVoxDB (currently the only one)
|
|
212
212
|
# is to store the node parameter 'trusted' as a hash of the trusted information.
|
|
213
213
|
#
|
|
214
214
|
# Thus here there are two main cases:
|
|
@@ -217,7 +217,7 @@ class Puppet::Node
|
|
|
217
217
|
# 2 It is a command line call with a given node that use a terminus that:
|
|
218
218
|
# 2.1 does not include a 'trusted' fact - use local from node trusted information
|
|
219
219
|
# 2.2 has a 'trusted' fact - this in turn could be
|
|
220
|
-
# 2.2.1
|
|
220
|
+
# 2.2.1 OpenVoxDB having stored trusted node data as a fact (not a great design)
|
|
221
221
|
# 2.2.2 some other terminus having stored a fact called "trusted" (most likely that would have failed earlier, but could
|
|
222
222
|
# be spoofed).
|
|
223
223
|
#
|
|
@@ -97,7 +97,7 @@ module Pal
|
|
|
97
97
|
internal_compiler.evaluate_additions
|
|
98
98
|
end
|
|
99
99
|
|
|
100
|
-
# Attempts to evaluate AST for node defnintions https://
|
|
100
|
+
# Attempts to evaluate AST for node defnintions https://docs.openvoxproject.org/openvox/latest/lang_node_definitions.html
|
|
101
101
|
# if there are any.
|
|
102
102
|
def evaluate_ast_node
|
|
103
103
|
internal_compiler.evaluate_ast_node
|
data/lib/puppet/pal/pal_impl.rb
CHANGED
|
@@ -107,30 +107,6 @@ module Pal
|
|
|
107
107
|
Puppet[:code] = previous_code_value
|
|
108
108
|
end
|
|
109
109
|
|
|
110
|
-
# Evaluates a Puppet Language script string.
|
|
111
|
-
# @param code_string [String] a snippet of Puppet Language source code
|
|
112
|
-
# @return [Object] what the Puppet Language code_string evaluates to
|
|
113
|
-
# @deprecated Use {#with_script_compiler} and then evaluate_string on the given compiler - to be removed in 1.0 version
|
|
114
|
-
#
|
|
115
|
-
def self.evaluate_script_string(code_string)
|
|
116
|
-
# prevent the default loading of Puppet[:manifest] which is the environment's manifest-dir by default settings
|
|
117
|
-
# by setting code_string to 'undef'
|
|
118
|
-
with_script_compiler do |compiler|
|
|
119
|
-
compiler.evaluate_string(code_string)
|
|
120
|
-
end
|
|
121
|
-
end
|
|
122
|
-
|
|
123
|
-
# Evaluates a Puppet Language script (.pp) file.
|
|
124
|
-
# @param manifest_file [String] a file with Puppet Language source code
|
|
125
|
-
# @return [Object] what the Puppet Language manifest_file contents evaluates to
|
|
126
|
-
# @deprecated Use {#with_script_compiler} and then evaluate_file on the given compiler - to be removed in 1.0 version
|
|
127
|
-
#
|
|
128
|
-
def self.evaluate_script_manifest(manifest_file)
|
|
129
|
-
with_script_compiler do |compiler|
|
|
130
|
-
compiler.evaluate_file(manifest_file)
|
|
131
|
-
end
|
|
132
|
-
end
|
|
133
|
-
|
|
134
110
|
# Defines a context in which multiple operations in an env with a catalog producing compiler can be performed
|
|
135
111
|
# in a given block.
|
|
136
112
|
# The calls that takes place to PAL inside of the given block are all with the same instance of the compiler.
|
|
@@ -411,7 +387,7 @@ module Pal
|
|
|
411
387
|
$LOAD_PATH << dir unless $LOAD_PATH.include?(dir)
|
|
412
388
|
end
|
|
413
389
|
|
|
414
|
-
#
|
|
390
|
+
# OpenVox requires OpenFact, which initializes its lookup paths. Reset OpenFact to
|
|
415
391
|
# pickup the new $LOAD_PATH.
|
|
416
392
|
Puppet.runtime[:facter].reset
|
|
417
393
|
|
|
@@ -28,7 +28,7 @@ class Puppet::Parser::Compiler
|
|
|
28
28
|
errors.each { |e| Puppet.err(e) } if errors.size > 1
|
|
29
29
|
errmsg = [
|
|
30
30
|
_("Compilation has been halted because: %{error}") % { error: errors.first },
|
|
31
|
-
_("For more information, see https://
|
|
31
|
+
_("For more information, see https://docs.openvoxproject.org/openvox/latest/environments_about.html")
|
|
32
32
|
]
|
|
33
33
|
raise(Puppet::Error, errmsg.join(' '))
|
|
34
34
|
end
|