Permalink
Browse files

Allow skipping php install, in case we already did it with php-fpm fo…

…r example
  • Loading branch information...
1 parent 1d8d0c0 commit bd2e3e1705843dd9d7f4784984a389474e7467bd @ivey ivey committed Apr 20, 2012
Showing with 5 additions and 7 deletions.
  1. +1 −0 attributes/default.rb
  2. +3 −6 recipes/default.rb
  3. +1 −1 recipes/drush.rb
View
@@ -27,6 +27,7 @@
default[:drupal][:site][:pass] = "drupaladmin"
default[:drupal][:site][:name] = "Drupal7"
default[:drupal][:webserver] = "apache2"
+default[:drupal][:skip_php] = false
::Chef::Node.send(:include, Opscode::OpenSSL::Password)
View
@@ -21,12 +21,12 @@
if node[:drupal][:webserver] == "apache2"
include_recipe %w{apache2 apache2::mod_php5 apache2::mod_rewrite apache2::mod_expires}
elsif node[:drupal][:webserver] == "nginx"
- include_recipe %w{nginx}
+ # include_recipe %w{nginx}
else
log("Only webservers currently supported: apache2 and nginx. You have: #{node[:drupal][:webserver]}") { level :warn }
end
-include_recipe %w{php php::module_mysql php::module_gd}
+include_recipe %w{php php::module_mysql php::module_gd} unless node[:drupal][:skip_php]
include_recipe "drupal::drush"
include_recipe "mysql::server"
@@ -51,10 +51,7 @@
execute "create #{node[:drupal][:db][:database]} database" do
command "/usr/bin/mysqladmin -u root -p#{node[:mysql][:server_root_password]} create #{node[:drupal][:db][:database]}"
- not_if do
- m = Mysql.new("localhost", "root", node[:mysql][:server_root_password])
- m.list_dbs.include?(node[:drupal][:db][:database])
- end
+ not_if "/usr/bin/mysql -u root -p#{node[:mysql][:server_root_password]} -e 'show databases' | grep -q #{node[:drupal][:db][:database]}"
end
execute "download-and-install-drupal" do
View
@@ -18,7 +18,7 @@
# limitations under the License.
#
-include_recipe %w{php php::module_mysql php::module_gd}
+include_recipe %w{php php::module_mysql php::module_gd} unless node[:drupal][:skip_php]
remote_file "#{node[:drupal][:src]}/drush-All-versions-#{node[:drupal][:drush][:version]}.tar.gz" do
checksum node[:drupal][:drush][:checksum]

0 comments on commit bd2e3e1

Please sign in to comment.