Sha256: 132261aa3d99cb7b4ca8734c551084bf010f3595233be2258dd4d808d5ed6f89

Contents?: true

Size: 920 Bytes

Versions: 8

Compression:

Stored size: 920 Bytes

Contents

module Kitchen
  module Transport
    class Winrm < Kitchen::Transport::Base
      # Monkey patch of test-kitchen winrm transport
      # that returns stdout
      class Connection < Kitchen::Transport::Base::Connection
        def node_execute(command, &block)
          session.run_powershell_script(command, &block)
        end
      end
    end
  end

  module Provisioner
    module IpFinder
      # WinRM implementation for returning active non-localhost IPs
      class Winrm
        def initialize(connection)
          @connection = connection
        end

        def find_ips
          out = @connection.node_execute(
            'Get-NetIPConfiguration | % { $_.ipv4address.IPAddress }')
          data = []
          out[:data].each do |out_data|
            stdout = out_data[:stdout]
            data << stdout.chomp unless stdout.nil?
          end
          data
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
kitchen-nodes-fqdn-0.4.1 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.4.1 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.4.0 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.3.4 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.3.3 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.3.2 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.3.1 lib/kitchen/provisioner/ip_finder/winrm.rb
kitchen-nodes-0.3.0 lib/kitchen/provisioner/ip_finder/winrm.rb