lib/bolt/config.rb in bolt-1.16.0 vs lib/bolt/config.rb in bolt-1.17.0

- old
+ new

@@ -29,12 +29,12 @@ super(msg, 'bolt/unknown-transport') end end class Config - attr_accessor :concurrency, :format, :trace, :log, :puppetdb, :color, - :transport, :transports, :inventoryfile, :compile_concurrency + attr_accessor :concurrency, :format, :trace, :log, :puppetdb, :color, :save_rerun, + :transport, :transports, :inventoryfile, :compile_concurrency, :boltdir attr_writer :modulepath TRANSPORT_OPTIONS = %i[password run-as sudo-password extensions private-key tty tmpdir user connect-timeout cacert token-file service-url interpreters file-protocol smb-port].freeze @@ -63,10 +63,11 @@ @compile_concurrency = Etc.nprocessors @transport = 'ssh' @format = 'human' @puppetdb = {} @color = true + @save_rerun = true # add an entry for the default console logger @log = { 'console' => {} } @transports = {} @@ -145,10 +146,12 @@ @inventoryfile = File.expand_path(data['inventoryfile'], @boltdir.path) if data.key?('inventoryfile') @hiera_config = File.expand_path(data['hiera-config'], @boltdir.path) if data.key?('hiera-config') @compile_concurrency = data['compile-concurrency'] if data.key?('compile-concurrency') + @save_rerun = data['save-rerun'] if data.key?('save-rerun') + %w[concurrency format puppetdb color transport].each do |key| send("#{key}=", data[key]) if data.key?(key) end TRANSPORTS.each do |key, impl| @@ -166,10 +169,12 @@ def apply_overrides(options) %i[concurrency transport format trace modulepath inventoryfile color].each do |key| send("#{key}=", options[key]) if options.key?(key) end + @save_rerun = options[:'save-rerun'] if options.key?(:'save-rerun') + if options[:debug] @log['console'][:level] = :debug elsif options[:verbose] @log['console'][:level] = :info end @@ -211,9 +216,13 @@ transports: @transports } end def default_inventoryfile [@boltdir.inventory_file] + end + + def rerunfile + @boltdir.rerunfile end def hiera_config @hiera_config || @boltdir.hiera_config end