[packages/vagrant] override chef install location in pld

glen glen at pld-linux.org
Wed Aug 19 16:25:40 CEST 2015


commit 28281fb459fd765d05862e7603dad02170a7b5db
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Wed Aug 19 17:06:35 2015 +0300

    override chef install location in pld

 pld-chef-installed.patch | 39 +++++++++++++++++++++++++++++++++++++++
 vagrant.spec             |  2 ++
 2 files changed, 41 insertions(+)
---
diff --git a/vagrant.spec b/vagrant.spec
index ba82d9f..df811f8 100644
--- a/vagrant.spec
+++ b/vagrant.spec
@@ -18,6 +18,7 @@ Patch5:		no-gems.patch
 Patch6:		checkpoint.patch
 Patch7:		insert-key.patch
 Patch8:		listen.patch
+Patch9:		pld-chef-installed.patch
 URL:		http://www.vagrantup.com/
 BuildRequires:	bash
 BuildRequires:	rpm-rubyprov
@@ -126,6 +127,7 @@ Ruby documentation for %{gem_name}
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 VERSION=$(cat version.txt)
 sed -i -e "s/__VERSION__/$VERSION/" lib/vagrant/version.rb
diff --git a/pld-chef-installed.patch b/pld-chef-installed.patch
new file mode 100644
index 0000000..6931665
--- /dev/null
+++ b/pld-chef-installed.patch
@@ -0,0 +1,39 @@
+--- vagrant-1.7.4/plugins/provisioners/chef/plugin.rb~	2015-07-17 22:38:51.000000000 +0300
++++ vagrant-1.7.4/plugins/provisioners/chef/plugin.rb	2015-08-19 17:03:47.474659244 +0300
+@@ -78,6 +78,11 @@
+         Cap::OmniOS::ChefInstalled
+       end
+ 
++      guest_capability(:pld, :chef_installed) do
++        require_relative "cap/pld/chef_installed"
++        Cap::OmniOS::ChefInstalled
++      end
++
+       guest_capability(:omnios, :chef_install) do
+         require_relative "cap/omnios/chef_install"
+         Cap::OmniOS::ChefInstall
+--- /dev/null	2015-05-25 21:49:42.000000000 +0300
++++ vagrant-1.7.4/plugins/provisioners/chef/cap/pld/chef_installed.rb	2015-08-19 17:02:22.571070868 +0300
+@@ -0,0 +1,22 @@
++module VagrantPlugins
++  module Chef
++    module Cap
++      module PLD
++        module ChefInstalled 
++          # Check if Chef is installed at the given version.
++          # @return [true, false]
++          def self.chef_installed(machine, version)
++            knife = "/usr/bin/knife"
++            command = "test -x #{knife}"
++            
++            if version != :latest
++              command << "&& #{knife} --version | grep 'Chef: #{version}'"
++            end
++
++            machine.communicate.test(command, sudo: true)         
++          end
++        end
++      end
++    end
++  end
++end
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/vagrant.git/commitdiff/3353e2a3bdd04afe0bde2a80870d466a3044391b



More information about the pld-cvs-commit mailing list