]> git.pld-linux.org Git - packages/vagrant.git/blob - pld-chef-installed.patch
VirtualBox is optional (can use other providers)
[packages/vagrant.git] / pld-chef-installed.patch
1 --- vagrant-1.7.4/plugins/provisioners/chef/plugin.rb   2015-08-19 17:03:47.474659244 +0300
2 +++ vagrant-1.7.4/plugins/provisioners/chef/plugin.rb   2015-08-19 17:28:22.723434523 +0300
3 @@ -73,11 +73,21 @@
4          Cap::Redhat::ChefInstall
5        end
6  
7 +      guest_capability(:pld, :chef_install) do
8 +        require_relative "cap/pld/chef_install"
9 +        Cap::PLD::ChefInstall
10 +      end
11 +
12        guest_capability(:omnios, :chef_installed) do
13          require_relative "cap/omnios/chef_installed"
14          Cap::OmniOS::ChefInstalled
15        end
16  
17 +      guest_capability(:pld, :chef_installed) do
18 +        require_relative "cap/pld/chef_installed"
19 +        Cap::PLD::ChefInstalled
20 +      end
21 +
22        guest_capability(:omnios, :chef_install) do
23          require_relative "cap/omnios/chef_install"
24          Cap::OmniOS::ChefInstall
25 --- /dev/null   2015-05-25 21:49:42.000000000 +0300
26 +++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_installed.rb   2015-08-19 17:02:22.571070868 +0300
27 @@ -0,0 +1,22 @@
28 +module VagrantPlugins
29 +  module Chef
30 +    module Cap
31 +      module PLD
32 +        module ChefInstalled
33 +          # Check if Chef is installed at the given version.
34 +          # @return [true, false]
35 +          def self.chef_installed(machine, version)
36 +            knife = "/usr/bin/chef-client"
37 +            command = "test -x #{knife}"
38 +
39 +            if version != :latest
40 +              command << "&& #{knife} --version | grep 'Chef: #{version}'"
41 +            end
42 +
43 +            machine.communicate.test(command, sudo: true)
44 +          end
45 +        end
46 +      end
47 +    end
48 +  end
49 +end
50 --- /dev/null   2015-05-25 21:49:42.000000000 +0300
51 +++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_install.rb     2015-08-19 17:27:55.925638979 +0300
52 @@ -0,0 +1,18 @@
53 +require_relative "../../omnibus"
54 +
55 +module VagrantPlugins
56 +  module Chef
57 +    module Cap
58 +      module PLD
59 +        module ChefInstall
60 +          def self.chef_install(machine, version, prerelease, download_path)
61 +            machine.communicate.sudo("poldek --up && poldek -u chef --noask")
62 +
63 +            command = Omnibus.build_command(version, prerelease, download_path)
64 +            machine.communicate.sudo(command)
65 +          end
66 +        end
67 +      end
68 +    end
69 +  end
70 +end
This page took 0.077631 seconds and 3 git commands to generate.