From 229ac5d3712f2b57a447738b8e5ea93608d2c283 Mon Sep 17 00:00:00 2001 From: Amruta Krishna Date: Tue, 20 May 2014 06:56:27 -0500 Subject: [PATCH] COOK-4666 Include attribute conditional check to install passenger module while installing through source method --- README.md | 1 + attributes/default.rb | 1 + recipes/source.rb | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index fe36d57..cb7f4bc 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ Attributes * `node['passenger']['apache_mpm']` - Override with an "override_attribute" (in a role, environment or with node.override) to "worker" or "threaded" to use apache2-threaded-dev package. Otherwise this assumes prefork. * `node['passenger']['package']['name']` - Name of the package for passenger, default is nil, so this must be set before using the "package" install method/recipe. * `node['passenger']['package']['version']` - Specify the version of the passenger package to install. Uses `version` attribute above by default. To install the version available by default (latest, usually), delete the attribute in a recipe with this line: +* `node['passenger']['install_module']` - Specify the boolean value which decides installing Passenger. Defaults to true, and setting to false skips the installation ```ruby node.set['passenger']['package'].delete('version') diff --git a/attributes/default.rb b/attributes/default.rb index 9a350fb..1c11297 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -10,3 +10,4 @@ # set package version to nil, the distro package may not be the same version default['passenger']['package']['version'] = nil default['passenger']['ruby_bin'] = languages['ruby']['ruby_bin'] +default['passenger']['install_module'] = true diff --git a/recipes/source.rb b/recipes/source.rb index e9365c1..b45b47d 100644 --- a/recipes/source.rb +++ b/recipes/source.rb @@ -50,4 +50,5 @@ execute "passenger_module" do command "#{node['passenger']['ruby_bin']} #{node['passenger']['root_path']}/bin/passenger-install-apache2-module _#{node['passenger']['version']}_ --auto" creates node['passenger']['module_path'] + only_if { node['passenger']['install_module'] } end