Giter Club home page Giter Club logo

chef-drupal-solr's Introduction

Drupal-Solr Cookbook

Build Status

Description

Installs and configures an Apache Solr application served by Tomcat, and connects an existing Drupal site to Solr.

Requirements

Chef >= 11.0.0

Platforms

Tested on Ubuntu 12.04 LTS, Drupal 6, 7, and Solr 1.4.

Usage with Vagrant

This repository includes an example Vagrantfile that spins up a virtual machine serving Drupal and then uses this cookbook to connect Drupal to Apache Solr. Drupal deployment is done using the deploy-drupal cookbook.

# requires Vagrant v1.1+
vagrant plugin install vagrant-berkshelf
vagrant up

Attributes

The following are the main attributes that this cookbook uses. All attributes mentioned below can be accessed in the cookbook via node['drupal-solr']['<attribute_name>']:

Attribute Name Default Description
solr_version 3.5.0 Apache Solr version to be installed. Use 1.4.0 with Drupal 6.
log_format common Tomcat log format for the Solr webapp
custom_conf_file '' Absolute path to file containing Tomcat context configuration for Solr webapp, cannot override global or default Host settings.
url r.f attributes/default.rb URL to download the stated solr_version from.
app_name solr name of the Solr Tomcat web application
war_dir /opt/solr absolute path to the directory containing Solr Docroot (solr.war will be placed here)
conf_source_glob solr-conf/solr-3.x/* path to drupalized solr config files, relative to apachesolr module
drupal_root '' absolute path to the existing Drupal site
make_solr_default_search true sets Solr as the default search engine for Drupal
index_drupal_content false sends the entire Drupal site content to Solr for indexing (will run drush solr-index at the end of Chef run.

chef-drupal-solr's People

Contributors

amirkdv avatar dergachev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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

chef-drupal-solr's Issues

Remove mysql_root_pass attribute

Sorry I didn't address this in #1

I think that the mysql_root_pass attribute can be removed. It's only used in the following code:

DB_ROOT_CONNECTION      = [ "mysql",
                            "--user='root'",
                            "--host='localhost'",
                            "--password='#{node['drupal-solr']['mysql_root_password']}'",
                            "--database='#{node['drupal-solr']['drupal_db']}'"
                          ].join(' ')

UPDATE_SOLR_SERVER_SQL  = [ "UPDATE apachesolr_environment",
                            "SET url=",
                            "'localhost:#{node['tomcat']['port']}/#{node['drupal-solr']['app_name']}'",
                            "WHERE env_id = 'solr'"
                          ].join(' ')
case node['drupal-solr']['drupal_version']
when /^7/
  # update the apachesolr_environment table to contain
  # url of the installed solr server
  execute "connect-drupal7-solr" do
    command "#{DB_ROOT_CONNECTION} -e \"#{UPDATE_SOLR_SERVER_SQL}\""
  end
when /^6/
  bash "connect-drupal6-solr" do
    code <<-EOH
      #{DRUSH} variable-set apachesolr_port #{node['tomcat']['port']}
      #{DRUSH} variable-set apachesolr_path /#{node['drupal-solr']['app_name']}
    EOH
  end
end

Instead you can just something like the following:

  execute "connect-drupal7-solr" do
    command "#{DRUSH} sql-query \"#{UPDATE_SOLR_SERVER_SQL}\""
  end

Seems like a much simpler way of doing this, unless I haven't really thought this through.

Allow a post-install-script to be specified

A common use case is to deploy a Drupal site and then include this cookbook to connect it to Solr. Typically one would want to index the Drupal site content after installing Solr and this cannot happen anytime before Solr is installed.

There should be a post-install-script attribute that points to a bash script to be executed upon Solr installation (and not on subsequent Chef runs).

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.