Sha256: 1abe6435bc354a06a381c3f13682dec3d13b508fc8ce9ade2ad8bb05b2a60496

Contents?: true

Size: 641 Bytes

Versions: 39

Compression:

Stored size: 641 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 "Chef: ' + 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

39 entries across 35 versions & 5 rubygems

Version Path
vagrant-unbundled-2.2.4.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.2.3.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.2.2.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.2.0.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.1.4.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.1.2.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.2 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/bundler/gems/vagrant-04f7215b5e3f/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.1.1.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.0.4.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.0.3.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-aws-detiber-0.7.2.pre.4 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-aws-detiber-0.7.2.pre.3 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-aws-detiber-0.7.2.pre.2 vendor/bundle/ruby/2.3.0/bundler/gems/vagrant-419afb4dcffe/plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.0.2.0 plugins/provisioners/chef/cap/windows/chef_installed.rb
vagrant-unbundled-2.0.1.0 plugins/provisioners/chef/cap/windows/chef_installed.rb