lib/bolt/config.rb in bolt-1.44.0 vs lib/bolt/config.rb in bolt-1.45.0

- old
+ new

@@ -31,11 +31,11 @@ end class Config attr_accessor :concurrency, :format, :trace, :log, :puppetdb, :color, :save_rerun, :transport, :transports, :inventoryfile, :compile_concurrency, :boltdir, - :puppetfile_config, :plugins, :plugin_hooks, :future + :puppetfile_config, :plugins, :plugin_hooks, :future, :trusted_external attr_writer :modulepath TRANSPORT_OPTIONS = %i[password run-as sudo-password extensions sudo-executable private-key tty tmpdir user connect-timeout disconnect-timeout cacert token-file service-url interpreters file-protocol smb-port realm].freeze @@ -160,10 +160,13 @@ if data.key?('puppetfile') @puppetfile_config = data['puppetfile'].select { |k, _| PUPPETFILE_OPTIONS.include?(k) } end @hiera_config = File.expand_path(data['hiera-config'], @boltdir.path) if data.key?('hiera-config') + @trusted_external = if data.key?('trusted-external-command') + File.expand_path(data['trusted-external-command'], @boltdir.path) + end @compile_concurrency = data['compile-concurrency'] if data.key?('compile-concurrency') @save_rerun = data['save-rerun'] if data.key?('save-rerun') @plugins = data['plugins'] if data.key?('plugins') @@ -289,9 +292,10 @@ unless %w[human json].include? @format raise Bolt::ValidationError, "Unsupported format: '#{@format}'" end Bolt::Util.validate_file('hiera-config', @hiera_config) if @hiera_config + Bolt::Util.validate_file('trusted-external-command', @trusted_external) if @trusted_external unless @transport.nil? || Bolt::TRANSPORTS.include?(@transport.to_sym) raise UnknownTransportError, @transport end