]>
Commit | Line | Data |
---|---|---|
865f5efe ER |
1 | upstream rejects this |
2 | ||
3 | https://github.com/mitchellh/vagrant/pull/6173 | |
4 | ||
27c6553b ER |
5 | --- vagrant-1.7.4/plugins/provisioners/chef/plugin.rb 2015-08-19 17:03:47.474659244 +0300 |
6 | +++ vagrant-1.7.4/plugins/provisioners/chef/plugin.rb 2015-08-19 17:28:22.723434523 +0300 | |
7 | @@ -73,11 +73,21 @@ | |
8 | Cap::Redhat::ChefInstall | |
9 | end | |
10 | ||
11 | + guest_capability(:pld, :chef_install) do | |
12 | + require_relative "cap/pld/chef_install" | |
13 | + Cap::PLD::ChefInstall | |
14 | + end | |
15 | + | |
16 | guest_capability(:omnios, :chef_installed) do | |
17 | require_relative "cap/omnios/chef_installed" | |
28281fb4 ER |
18 | Cap::OmniOS::ChefInstalled |
19 | end | |
20 | ||
21 | + guest_capability(:pld, :chef_installed) do | |
22 | + require_relative "cap/pld/chef_installed" | |
168102bd | 23 | + Cap::PLD::ChefInstalled |
28281fb4 ER |
24 | + end |
25 | + | |
26 | guest_capability(:omnios, :chef_install) do | |
27 | require_relative "cap/omnios/chef_install" | |
28 | Cap::OmniOS::ChefInstall | |
29 | --- /dev/null 2015-05-25 21:49:42.000000000 +0300 | |
30 | +++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_installed.rb 2015-08-19 17:02:22.571070868 +0300 | |
31 | @@ -0,0 +1,22 @@ | |
32 | +module VagrantPlugins | |
33 | + module Chef | |
34 | + module Cap | |
35 | + module PLD | |
3353e2a3 | 36 | + module ChefInstalled |
28281fb4 ER |
37 | + # Check if Chef is installed at the given version. |
38 | + # @return [true, false] | |
39 | + def self.chef_installed(machine, version) | |
3353e2a3 | 40 | + knife = "/usr/bin/chef-client" |
28281fb4 | 41 | + command = "test -x #{knife}" |
3353e2a3 | 42 | + |
28281fb4 ER |
43 | + if version != :latest |
44 | + command << "&& #{knife} --version | grep 'Chef: #{version}'" | |
45 | + end | |
46 | + | |
3353e2a3 | 47 | + machine.communicate.test(command, sudo: true) |
28281fb4 ER |
48 | + end |
49 | + end | |
50 | + end | |
51 | + end | |
52 | + end | |
53 | +end | |
27c6553b ER |
54 | --- /dev/null 2015-05-25 21:49:42.000000000 +0300 |
55 | +++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_install.rb 2015-08-19 17:27:55.925638979 +0300 | |
56 | @@ -0,0 +1,18 @@ | |
57 | +require_relative "../../omnibus" | |
58 | + | |
59 | +module VagrantPlugins | |
60 | + module Chef | |
61 | + module Cap | |
62 | + module PLD | |
63 | + module ChefInstall | |
64 | + def self.chef_install(machine, version, prerelease, download_path) | |
65 | + machine.communicate.sudo("poldek --up && poldek -u chef --noask") | |
66 | + | |
67 | + command = Omnibus.build_command(version, prerelease, download_path) | |
68 | + machine.communicate.sudo(command) | |
69 | + end | |
70 | + end | |
71 | + end | |
72 | + end | |
73 | + end | |
74 | +end |