Sha256: f8ac348ff1abdf7e11bb1afe622d096ca0524971470cffb01211f2d2b094dfd2

Contents?: true

Size: 1.52 KB

Versions: 53

Compression:

Stored size: 1.52 KB

Contents

# frozen_string_literal: true

require 'bolt/error'
require 'bolt/config/transport/base'

module Bolt
  class Config
    module Transport
      class WinRM < Base
        OPTIONS = %w[
          basic-auth-only
          cacert
          cleanup
          connect-timeout
          extensions
          file-protocol
          host
          interpreters
          password
          port
          realm
          smb-port
          ssl
          ssl-verify
          tmpdir
          user
        ].freeze

        DEFAULTS = {
          "basic-auth-only" => false,
          "cleanup"         => true,
          "connect-timeout" => 10,
          "ssl"             => true,
          "ssl-verify"      => true,
          "file-protocol"   => "winrm"
        }.freeze

        private def validate
          super

          if @config['ssl']
            if @config['file-protocol'] == 'smb'
              raise Bolt::ValidationError, "SMB file transfers are not allowed with SSL enabled"
            end

            if @config['cacert']
              @config['cacert'] = File.expand_path(@config['cacert'], @project)
              Bolt::Util.validate_file('cacert', @config['cacert'])
            end
          end

          if !@config['ssl'] && @config['basic-auth-only']
            raise Bolt::ValidationError, "Basic auth is only allowed when using SSL"
          end

          if @config['interpreters']
            @config['interpreters'] = normalize_interpreters(@config['interpreters'])
          end
        end
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
bolt-3.17.0 lib/bolt/config/transport/winrm.rb
bolt-3.16.1 lib/bolt/config/transport/winrm.rb
bolt-3.16.0 lib/bolt/config/transport/winrm.rb
bolt-3.15.0 lib/bolt/config/transport/winrm.rb
bolt-3.14.1 lib/bolt/config/transport/winrm.rb
bolt-3.13.0 lib/bolt/config/transport/winrm.rb
bolt-3.12.0 lib/bolt/config/transport/winrm.rb
bolt-3.11.0 lib/bolt/config/transport/winrm.rb
bolt-3.10.0 lib/bolt/config/transport/winrm.rb
bolt-3.9.2 lib/bolt/config/transport/winrm.rb
bolt-3.9.1 lib/bolt/config/transport/winrm.rb
bolt-3.9.0 lib/bolt/config/transport/winrm.rb
bolt-3.8.1 lib/bolt/config/transport/winrm.rb
bolt-3.8.0 lib/bolt/config/transport/winrm.rb
bolt-3.7.1 lib/bolt/config/transport/winrm.rb
bolt-3.7.0 lib/bolt/config/transport/winrm.rb
bolt-3.6.1 lib/bolt/config/transport/winrm.rb
bolt-3.6.0 lib/bolt/config/transport/winrm.rb
bolt-3.5.0 lib/bolt/config/transport/winrm.rb
bolt-3.4.0 lib/bolt/config/transport/winrm.rb