]>
Commit | Line | Data |
---|---|---|
28281fb4 ER |
1 | --- vagrant-1.7.4/plugins/provisioners/chef/plugin.rb~ 2015-07-17 22:38:51.000000000 +0300 |
2 | +++ vagrant-1.7.4/plugins/provisioners/chef/plugin.rb 2015-08-19 17:03:47.474659244 +0300 | |
3 | @@ -78,6 +78,11 @@ | |
4 | Cap::OmniOS::ChefInstalled | |
5 | end | |
6 | ||
7 | + guest_capability(:pld, :chef_installed) do | |
8 | + require_relative "cap/pld/chef_installed" | |
168102bd | 9 | + Cap::PLD::ChefInstalled |
28281fb4 ER |
10 | + end |
11 | + | |
12 | guest_capability(:omnios, :chef_install) do | |
13 | require_relative "cap/omnios/chef_install" | |
14 | Cap::OmniOS::ChefInstall | |
15 | --- /dev/null 2015-05-25 21:49:42.000000000 +0300 | |
16 | +++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_installed.rb 2015-08-19 17:02:22.571070868 +0300 | |
17 | @@ -0,0 +1,22 @@ | |
18 | +module VagrantPlugins | |
19 | + module Chef | |
20 | + module Cap | |
21 | + module PLD | |
3353e2a3 | 22 | + module ChefInstalled |
28281fb4 ER |
23 | + # Check if Chef is installed at the given version. |
24 | + # @return [true, false] | |
25 | + def self.chef_installed(machine, version) | |
3353e2a3 | 26 | + knife = "/usr/bin/chef-client" |
28281fb4 | 27 | + command = "test -x #{knife}" |
3353e2a3 | 28 | + |
28281fb4 ER |
29 | + if version != :latest |
30 | + command << "&& #{knife} --version | grep 'Chef: #{version}'" | |
31 | + end | |
32 | + | |
3353e2a3 | 33 | + machine.communicate.test(command, sudo: true) |
28281fb4 ER |
34 | + end |
35 | + end | |
36 | + end | |
37 | + end | |
38 | + end | |
39 | +end |