Sha256: 103893708b29de1ac49d5130d1dcbfbca2743d5d0bcfb9a645677832d18a3626
Contents?: true
Size: 633 Bytes
Versions: 12
Compression:
Stored size: 633 Bytes
Contents
module VagrantPlugins module Chef module Cap module Windows module ChefInstalled # Check if Chef is installed at the given version. # @return [true, false] def self.chef_installed(machine, product, version) if version != :latest command = 'if ((&knife --version) -Match "' + version.to_s + '"){ exit 0 } else { exit 1 }' else command = 'if ((&knife --version) -Match "Chef*"){ exit 0 } else { exit 1 }' end machine.communicate.test(command, sudo: true) end end end end end end
Version data entries
12 entries across 12 versions & 2 rubygems