GithubHelp home page GithubHelp logo

drupal-cookbook's Introduction

drupal-cookbook Build Status

Description

Installs and configures Drupal; it creates the drupal db user, db password and the database; You will need to manually complete the installation step by visiting http://server_fqdn/install.php

Requirements

Platform:

Tested on Ubuntu 10.04, Debian Lenny. As long as the required cookbooks work (apache, php, mysql) it should work just fine on any other distributions.

Cookbooks:

Opscode cookbooks (http://github.com/opscode/cookbooks/tree/master)

  • mysql
  • php
  • apache2
  • openssl (used to generate the secure random drupal db password)
  • postfix

ATTRIBUTES:

  • drupal[:version] - version of drupal to download and install (default: 6.19)

  • drupal[:checksum] - sha256sum of the source tarball

  • drupal[:dir] - location to copy the drupal files. (default: /var/www/drupal)

  • drupal[:db][:database] - drupal database (default: drupal)

  • drupal[:db][:user] - drupal db user (default: drupal)

  • drupal[:db][:host] - durpal db host (default: localhost)

  • drupal[:db][:password] - drupal db password (randomly generated if not defined)

  • drupal[:src] - where to place the drupal source tarball (default: Chef::Config[:file_cache_path])

  • drupal[:drush][:version] - version of drush to download (default: 3.3)

  • drupal[:drush][:checksum] - sha256sum of the drush tarball

  • drupal[:drush][:dir] - where to install the drush file. (default: /usr/local/drush)

USAGE:

Include the drupal recipe to install drupal on your system; this will enable also the drupal cron:

include_recipe "drupal"

Include the drush recipe to install drush:

include_recipe "drupal::drush"

If you want to install a different version you just have to customize the version attribute and checksum (sha256 checksum on the source)

License and Author

Author:: Marius Ducea ([email protected])

Copyright:: 2010-2012, Promet Solutions

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

drupal-cookbook's People

Contributors

cdracars avatar dkinzer avatar gondoi avatar mdxp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

drupal-cookbook's Issues

mysql::client and mysql::server don't exist

The default recipe tries to call mysql::client and mysql::server accordingly. Such a setup where mysql having recipes viz. client and server can only be found in versions prior to 6.0.0. Can you just let me know to which version of dependencies are you using... it will be helpful! thanks :)

Active drupal cookbook would be nice - will help in maintenance

There are some very old bugs and pull reqests.

It would be nice to have the drupal cookbook under active maintenance!

I will voluntarily help to get this cookbook up to date and keep it there. As i do with some other applicaton cookbooks.

Thanks for an answer and thanks to all Users who file issues and pullrequests!

Cannot deploy

Hi,

I just included the recipe; when I run chef-solo, i get :

Recipe Compile Error in /var/chef/cookbooks/drupal/attributes/default.rb

NameError

uninitialized constant Chef::Node::Opscode

Cookbook Trace:

/var/chef/cookbooks/drupal/attributes/default.rb:32:in `from_file'

Relevant File Content:

/var/chef/cookbooks/drupal/attributes/default.rb:

25: default['drupal']['db']['user'] = "drupal"
26: default['drupal']['db']['host'] = "localhost"
27: default['drupal']['site']['admin'] = "admin"
28: default['drupal']['site']['pass'] = "drupaladmin"
29: default['drupal']['site']['name'] = "Drupal7"
30: default['drupal']['apache']['port'] = "80"
31:
32>> ::Chef::Node.send(:include, Opscode::OpenSSL::Password)
33:
34: set_unless['drupal']['db']['password'] = secure_password
35: default['drupal']['src'] = Chef::Config[:file_cache_path]
36:
37: default['drupal']['drush']['version'] = "7.x-5.4"
38: default['drupal']['drush']['checksum'] = "6cea1275f2aad22b8d3474bb34b4494f069f823feecccb7edb399631f0b0ca40"
39: default['drupal']['drush']['dir'] = "/usr/local/drush"
40:
41: default['drupal']['modules'] = ["views", "webform"]

Missing depnedencies in README.md

it says

*mysql
*php
*apache2
*openssl (used to generate the secure random drupal db password)
*postfix

but in reality is..

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

Deploying a 2nd time causes drush to hang

What can bw wrong there ?

Error executing action run on resource 'execute[drush_en_module views]'

Mixlib::ShellOut::ShellCommandFailed

Expected process to exit with [0], but received '1'
---- Begin output of /usr/local/drush/drush -y en views ----
STDOUT:
STDERR: Command pm-enable needs a higher bootstrap level to run - you will [error]
need invoke drush from a more functional Drupal environment to run
this command.
The drush command 'en views' could not be executed. [error]
Drush was not able to start (bootstrap) the Drupal database. [error]
Hint: This error often occurs when Drush is trying to bootstrap a
site that has not been installed or does not have a configured
database.

Drush was attempting to connect to :
Drupal version : 7.14
Site URI : http://default
Database driver : mysql
Database hostname : localhost
Database username : drupal
Database name : drupal
Default theme : garland
Administration theme: garland
PHP configuration : /etc/php5/cli/php.ini
Drush version : 5.4
Drush configuration:
Drupal root : /var/www/drupal
Site path : sites/default
Modules path : sites/all/modules
Themes path : sites/all/themes
File directory path: sites/default/files
%paths : Array

You can select another site with a working database setup by
specifying the URI to use with the --uri parameter on the command
line or $options['uri'] in your drushrc.php file.
---- End output of /usr/local/drush/drush -y en views ----
Ran /usr/local/drush/drush -y en views returned 1

Vagrant doesn't seem to work

I checked out the master (b446aea) and tried to use the Vagrant doing the following. Which didn't work with Vagrant 1.3.3.

$ git clone https://github.com/promet/drupal-cookbook.git
Cloning into 'drupal-cookbook'...
remote: Counting objects: 304, done.
remote: Compressing objects: 100% (161/161), done.
remote: Total 304 (delta 124), reused 266 (delta 102)
Receiving objects: 100% (304/304), 44.18 KiB | 0 bytes/s, done.
Resolving deltas: 100% (124/124), done.
Checking connectivity... done

$ cd drupal-cookbook

$ vagrant up
Vagrant failed to initialize at a very early stage:

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /Users/oconnor/Sites/demos/drupal-cookbook/Vagrantfile
Message: cannot load such file -- berkshelf/vagrant

Seems to be an error with the way apache and php are used fro 2.4

This has been working fine in the past for me, but today when using it I get this error when trying to restart apache

[Mon Apr 13 14:05:22.597402 2015] [:crit] [pid 24348:tid 140186692597632] Apache is running a threaded MPM, but your PHP Module is not compiled to be threadsafe. You need to recompile PHP.
AH00013: Pre-configuration failed

This happens on Ubuntu 14.04 and CentOS 7 (both using Apache 2.4) but seems to work with Apache 2.2 just fine. This may be an upstream error or it might just be the way they're being called, I'm not sure. I don't see any updates to Apache or PHP cookbooks that would have caused this chang ein behavior though.

Unable to Install Drush on Centos 7

============================================================================

Error executing action `run` on resource 'execute[drupal-make-drush-install]

'

============================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '2'
---- Begin output of composer global require drush/drush:dev-master ----
STDOUT:
STDERR: Changed current directory to /root/.composer
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for drush/drush dev-master -> satisfiable by drus

h/drush[dev-master].
- drush/drush dev-master requires php >=5.5.0 -> your PHP version (5.4.1
6) does not satisfy that requirement.

Installation failed, deleting ./composer.json.
---- End output of composer global require drush/drush:dev-master ----
Ran composer global require drush/drush:dev-master returned 2

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/activelamp_drupal/recipes/drush.rb

 12: execute 'drupal-make-drush-install' do
 13:   creates composer_drush_path
 14:   command  "#{ node[:activelamp_drupal][:drush][:composer_command] } gl

obal require drush/drush:#{ drush_version }"
15: user node[:activelamp_drupal][:drush][:user]
16: group node[:activelamp_drupal][:drush][:group]
17: environment({
18: 'COMPOSER_HOME' => composer_home
19: })
20: end
21:

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/activelamp_drupal/recipes/drush.rb:1

2:in `from_file'

execute("drupal-make-drush-install") do
  action [:run]
  retries 0
  retry_delay 2
  default_guard_interpreter :execute
  command "composer global require drush/drush:dev-master"
  backup 5
  creates "/root/.composer/vendor/bin/drush"
  environment {"COMPOSER_HOME"=>"/root/.composer"}
  group "root"
  returns 0
  user "root"
  declared_type :execute
  cookbook_name "activelamp_drupal"
  recipe_name "drush"
end

How can I solve this?

sudo: Sorry, you must have a tty to run sudo while deploying in centos 7.1

============================================================================

Error executing action `run` on resource 'execute[download_drupal]'
============================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of sudo /usr/local/bin/drush dl drupal --drupal-project-re

name=drupal -y ----
STDOUT:
STDERR: sudo: sorry, you must have a tty to run sudo
---- End output of sudo /usr/local/bin/drush dl drupal --drupal-project-rena
me=drupal -y ----
Ran sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupal -y re
turned 1

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/drupal-cookbook/recipes/install.rb

 20: execute 'download_drupal' do
 21:        if Dir.exist?(drupal_dir)
 22:                only_if "#{(Dir.entries(drupal_dir) - %w{ . .. }).empty?

}"
23: end
24: command 'sudo /usr/local/bin/drush dl drupal --drupal-project-re
name=drupal -y'

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/drupal-cookbook/recipes/install.rb:2

0:in `from_file'

execute("download_drupal") do
  action [:run]
  retries 0
  retry_delay 2
  default_guard_interpreter :execute
  command "sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupa

l -y"
backup 5
cwd "/var/www"
returns 0
declared_type :execute
cookbook_name "drupal-cookbook"
recipe_name "install"
only_if "true"
end

Running handlers:
[2016-03-11T12:11:27+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-03-11T12:11:27+00:00] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated in 16 seconds
[2016-03-11T12:11:27+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-sta
cktrace.out
[2016-03-11T12:11:27+00:00] FATAL: Please provide the contents of the stacktrace
.out file if you file a bug report
[2016-03-11T12:11:27+00:00] ERROR: execute[download_drupal](drupal-cookbook::in
stall line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected proc
ess to exit with [0], but received '1'
---- Begin output of sudo /usr/local/bin/drush dl drupal --drupal-project-rename
=drupal -y ----
STDOUT:
STDERR: sudo: sorry, you must have a tty to run sudo
---- End output of sudo /usr/local/bin/drush dl drupal --drupal-project-rename=d
rupal -y ----
Ran sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupal -y return
ed 1
[2016-03-11T12:11:28+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef ru
n process exited unsuccessfully (exit code 1)

Error Deploying on Ubuntu 14.04 due to the following command

execute "mysql-install-drupal-privileges" do
command "/usr/bin/mysql -h #{node['drupal']['db']['host']} -u root -p#{node['mysql']['server_root_password']} < /etc/mysql/drupal-grants.sql"
action :nothing
end

The present mysql cookbook doesnot work. Which mysql cookbook should I use?

sudo: Sorry, you must have a tty to run sudo while deploying in centos 7.1

============================================================================

Error executing action `run` on resource 'execute[download_drupal]'
============================================================================

Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of sudo /usr/local/bin/drush dl drupal --drupal-project-re

name=drupal -y ----
STDOUT:
STDERR: sudo: sorry, you must have a tty to run sudo
---- End output of sudo /usr/local/bin/drush dl drupal --drupal-project-rena
me=drupal -y ----
Ran sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupal -y re
turned 1

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/drupal-cookbook/recipes/install.rb

 20: execute 'download_drupal' do
 21:        if Dir.exist?(drupal_dir)
 22:                only_if "#{(Dir.entries(drupal_dir) - %w{ . .. }).empty?

}"
23: end
24: command 'sudo /usr/local/bin/drush dl drupal --drupal-project-re
name=drupal -y'

Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/drupal-cookbook/recipes/install.rb:2

0:in `from_file'

execute("download_drupal") do
  action [:run]
  retries 0
  retry_delay 2
  default_guard_interpreter :execute
  command "sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupa

l -y"
backup 5
cwd "/var/www"
returns 0
declared_type :execute
cookbook_name "drupal-cookbook"
recipe_name "install"
only_if "true"
end

Running handlers:
[2016-03-11T12:11:27+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-03-11T12:11:27+00:00] ERROR: Exception handlers complete
Chef Client failed. 2 resources updated in 16 seconds
[2016-03-11T12:11:27+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-sta
cktrace.out
[2016-03-11T12:11:27+00:00] FATAL: Please provide the contents of the stacktrace
.out file if you file a bug report
[2016-03-11T12:11:27+00:00] ERROR: execute[download_drupal](drupal-cookbook::in
stall line 20) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected proc
ess to exit with [0], but received '1'
---- Begin output of sudo /usr/local/bin/drush dl drupal --drupal-project-rename
=drupal -y ----
STDOUT:
STDERR: sudo: sorry, you must have a tty to run sudo
---- End output of sudo /usr/local/bin/drush dl drupal --drupal-project-rename=d
rupal -y ----
Ran sudo /usr/local/bin/drush dl drupal --drupal-project-rename=drupal -y return
ed 1
[2016-03-11T12:11:28+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef ru
n process exited unsuccessfully (exit code 1)

Remove postfix dependency

Its not clear to me why there is a dependency to postfix. It is not used by the cookbook at all. So is there a reason I oversee?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.