Sha256: a9db616a97e79d6b4d2683cb92086580a85f37301a74f57a452c6e48c7d11857

Contents?: true

Size: 899 Bytes

Versions: 1

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

require 'bolt/logger'
require 'bolt/transport/simple'

module Bolt
  module Transport
    class Local < Simple
      def connected?(_target)
        true
      end

      def with_connection(target)
        if target.transport_config['bundled-ruby'] || target.name == 'localhost'
          target.set_local_defaults
        end

        if target.name != 'localhost' &&
           !target.transport_config.key?('bundled-ruby')
          msg = "The local transport will default to using Bolt's Ruby interpreter and "\
            "setting the 'puppet-agent' feature in Bolt 3.0. Enable or disable these "\
            "defaults by setting 'bundled-ruby' in the local transport config."
          Bolt::Logger.warn_once("local_default_config", msg)
        end

        yield Connection.new(target)
      end
    end
  end
end

require 'bolt/transport/local/connection'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bolt-2.44.0 lib/bolt/transport/local.rb