Sha256: ef4c56b101da4518d1549d8116073e5ad9df3e0b335965a9847fadfe85346875

Contents?: true

Size: 541 Bytes

Versions: 2

Compression:

Stored size: 541 Bytes

Contents

# frozen_string_literal: true

module VagrantPlugins
  module K3s
    module Cap
      module Linux
        module K3sInstalled
          # Check if K3s is installed at the given version.
          # @return [true, false]
          def self.k3s_installed(machine, k3s="k3s")
            machine.communicate.execute("/usr/bin/which k3s") do |type, data|
              k3s = data.to_s if type == :stdout
            end
            machine.communicate.test("#{k3s} --version", sudo: true)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
vagrant-k3s-0.1.1 lib/vagrant-k3s/cap/linux/k3s_installed.rb
vagrant-k3s-0.1.0 lib/vagrant-k3s/cap/linux/k3s_installed.rb