Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2a31335
Clean up a little to make vendor-cookbooks friendly
Sep 18, 2013
c200d38
Adjust server_name
Sep 18, 2013
0f84ad1
1.1.3
Sep 18, 2013
959b322
Don't install drush by default
Sep 18, 2013
86fd2cb
Allow us to use another drush cookbook (+1 squashed commit)
Sep 18, 2013
ea95772
* hostsfile to manage /etc/hosts
Sep 18, 2013
d3538e7
* hostsfile to manage /etc/hosts
Sep 18, 2013
a6e0c02
* Correct hostsfile_entry name
Sep 18, 2013
79802cd
Allow the drupal web_app to be disabled but retain default behavior
dldinternet Sep 24, 2013
14fad08
* Set Drupal docroot permissions correctly
dldinternet Oct 2, 2013
fa0a521
v1.1.9 Standardize the default[:drupal][:db] array
dldinternet Oct 2, 2013
9d19b0c
Fix OpenSSL dep
dldinternet Oct 2, 2013
2438136
v1.1.10 Fix the drupal docroot permissions as per best practices shel…
dldinternet Oct 2, 2013
9c3af11
- Set rx on all directories of the DocumentRoot path
dldinternet Oct 3, 2013
6e407f5
- Set rx on all directories of the DocumentRoot path
dldinternet Oct 3, 2013
676662c
- Creating the settings.php based on Drupal unpack chain has pitfalls…
dldinternet Oct 8, 2013
c44a5f3
- Modules will not install until the site-install is complete and was…
dldinternet Oct 8, 2013
a6099d0
- Allow template to be created and maintained without triggering repe…
dldinternet Oct 9, 2013
77ec4cd
- Fix fatal log for sites/default/settings.php from sites/default/fil…
dldinternet Oct 13, 2013
79f09a7
- Fix dependencies of sites/default/files/settings.php
dldinternet Oct 15, 2013
d4a2ba5
Refuse to (re)install the site when the database host is not 127.0.0.…
dldinternet Oct 15, 2013
b0a35b3
- Prevent site-install from being triggered repeatedly!
dldinternet Oct 16, 2013
75475a4
- Notify mysql grants creation
dldinternet Oct 16, 2013
82b9a02
- Support Drupal 6
dldinternet Oct 17, 2013
3274733
Allow force install to overwrite settings.php
dldinternet Nov 19, 2013
fb0910f
Allow force install to overwrite settings.php
dldinternet Nov 19, 2013
f177b36
1.1.23
dldinternet Dec 24, 2013
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tmp/
*.swp
.rvmrc

.idea
103 changes: 103 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,106 @@
Drupal Cookbook CHANGELOG
======================
This file is used to list changes made in each version of the drupal cookbook.

## v1.1.21
------
### Improvement
- Allow force install

## v1.1.20
------
### Improvement
- Support Drupal 6
- Support stripping comments out of settings.php

## v1.1.19
------
### Improvement
- Notify mysql grants creation

## v1.1.18
------
### Bug
- Prevent site-install from being triggered repeatedly!

## v1.1.17
------
### Improvement
- Refuse to (re)install the site when the database host is not 127.0.0.1. We do NOT want to wipe out content!

## v1.1.16
------
### Bug
- Fix dependencies of sites/default/files/settings.php

## v1.1.15
------
### Bug
- Fix fatal log for sites/default/settings.php from sites/default/files/settings.php

## v1.1.14
------
### Improvement
- Allow template to be created and maintained without triggering repeated site installs!

## v1.1.13
------
### Improvement
- Modules will not install until the site-install is complete and was successful

## v1.1.12
------
### Improvement
- Creating the settings.php based on Drupal unpack chain has pitfalls. Let's just create it if it is missing.

## v1.1.11
------
### Bug
- Set rx on all directories of the DocumentRoot path

## v1.1.10:

* Finetune the Drupal docroot file and directory permissions

## v1.1.9:

* Standardize the default[:drupal][:db] array

## v1.1.8:

* Set Drupal docroot permissions correctly
* Allow web_app to be disabled

## v1.1.7:

* Correct hostsfile_entry name
* ctools module installed by default because of webform
* patches support

## v1.1.6:

* hostsfile to manage /etc/hosts

## v1.1.5:

* Rework dependencies and sequence to support non-root credentials for mysql
* Set permissions on docroot
* Restart Apache if necessary

## v1.1.4:

* Allow us to use another drush cookbook

## v1.1.3:

* Don't install drush by default

## v1.1.2:

* Default to 7.23
* Consider 127.0.0.1 localhost also
*

## v1.1.0:

* fix bug caused by the removal of `mysql_database` LWRP from the mysql cookbook starting with version 1.2.0
Expand Down
25 changes: 20 additions & 5 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,40 @@
# limitations under the License.
#

default['drupal']['version'] = "7.18"
default['drupal']['version'] = "7.23"
default['drupal']['dir'] = "/var/www/drupal"
default['drupal']['owner'] = "root"
default['drupal']['group'] = "root"

default['drupal']['db']['driver'] = "mysql"
default['drupal']['db']['database'] = "drupal"
default['drupal']['db']['user'] = "drupal"
default['drupal']['db']['host'] = "localhost"
default['drupal']['db']['port'] = "3306"
default['drupal']['db']['prefix'] = ""
#default['drupal']['db']['password'] = "localhost"

::Chef::Node.send(:include, Opscode::OpenSSL::Password)
set_unless['drupal']['db']['password'] = secure_password

default['drupal']['site']['admin'] = "admin"
default['drupal']['site']['pass'] = "drupaladmin"
default['drupal']['site']['name'] = "Drupal7"
default['drupal']['site']['host'] = "localhost"
default['drupal']['apache']['port'] = "80"

::Chef::Node.send(:include, Opscode::OpenSSL::Password)
default['drupal']['apache']['port'] = "80"
default['drupal']['server_name'] = fqdn
default['drupal']['web_app']['enable'] = true

set_unless['drupal']['db']['password'] = secure_password
default['drupal']['src'] = Chef::Config[:file_cache_path]

default['drupal']['drush']['recipe'] = "own"
default['drupal']['drush']['version'] = "7.x-5.8"
default['drupal']['drush']['checksum'] = "15dd85f04c49b4a896b02dd6960d3140f3ae680bab3eea5d3aba27be0481e480"
default['drupal']['drush']['dir'] = "/usr/local/drush"

default['drupal']['modules'] = ["views", "webform"]
default['drupal']['modules'] = ["ctools", "views", "webform"]

default['drupal']['sites']['default']['settings']['template'] = false
default['drupal']['sites']['default']['settings']['cookbook'] = 'drupal'
default['drupal']['sites']['default']['settings']['action'] = 'create_if_missing'
38 changes: 21 additions & 17 deletions definitions/drupal_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,27 @@

define :drupal_module, :action => :install, :dir => nil, :version => nil do
case params[:action]
when :install
if params[:dir] == nil then
log("drupal_module_install requires a working drupal dir") { level :fatal }
raise "drupal_module_install requires a working drupal dir"
end
execute "drush_dl_module #{params[:name]}" do
cwd params[:dir]
command "#{node['drupal']['drush']['dir']}/drush -y dl #{params[:name]}"
not_if "#{node['drupal']['drush']['dir']}/drush -r #{params[:dir]} pm-list |grep '(#{params[:name]})' |grep '#{params[:version]}'"
end
execute "drush_en_module #{params[:name]}" do
cwd params[:dir]
command "#{node['drupal']['drush']['dir']}/drush -y en #{params[:name]}"
not_if "#{node['drupal']['drush']['dir']}/drush -r #{params[:dir]} pm-list |grep '(#{params[:name]})' |grep -i 'enabled'"
end
else
log "drupal_source action #{params[:name]} is unrecognized."
when :install
if params[:dir] == nil then
log("drupal_module_install requires a working drupal dir") { level :fatal }
raise "drupal_module_install requires a working drupal dir"
end
execute "drush_dl_module #{params[:name]}" do
cwd params[:dir]
command "#{node['drupal']['drush']['dir']}/drush -y dl #{params[:name]}"
not_if "#{node['drupal']['drush']['dir']}/drush -r #{params[:dir]} pm-list |grep '(#{params[:name]})' |grep '#{params[:version]}'"
#action :nothing
#subscribes :run, "execute[configure-drupal]", :delayed
end
execute "drush_en_module #{params[:name]}" do
cwd params[:dir]
command "#{node['drupal']['drush']['dir']}/drush -y en #{params[:name]}"
not_if "#{node['drupal']['drush']['dir']}/drush -r #{params[:dir]} pm-list |grep '(#{params[:name]})' |grep -i 'enabled'"
#action :nothing
#subscribes :run, "execute[drush_en_module #{params[:name]}]", :delayed
end
else
log "drupal_source action #{params[:name]} is unrecognized."
end
end

20 changes: 14 additions & 6 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,24 @@
name "drupal"
description "Installs/Configures drupal"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "1.1.1"
version "1.1.23"
recipe "drupal", "Installs and configures Drupal"
recipe "drupal::cron", "Sets up the default drupal cron"
recipe "drupal::drush", "Installs drush - a command line shell and scripting interface for Drupal"

%w{ postfix php apache2 mysql openssl firewall cron }.each do |cb|
depends cb
end
# %w{ postfix php apache2 mysql openssl firewall cron }.each do |cb|
# depends cb
# end
depends "postfix"
depends "php"
depends "apache2"
depends "mysql"
depends "openssl"
depends "cron"
depends "firewall"
depends "drush"
depends "hostsfile"

%w{ debian ubuntu }.each do |os|
supports os
supports os
end

Loading