From 1658acd528583df0bed7581723fb9c87eb17f174 Mon Sep 17 00:00:00 2001 From: Bec White Date: Mon, 2 Apr 2018 19:44:09 -0500 Subject: [PATCH 1/8] Temporarily don't install Jetty or Solr. --- drupalbox/drupalbox.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index 0d51d33..4111c37 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -30,8 +30,8 @@ } - { role: memcached } - { role: mailhog } - - { role: jetty9 } - - { role: solr } + #- { role: jetty9 } + #- { role: solr } - { role: apache } - { role: mysql-client } - { role: mysql-server } From 014df0f3bda2bd36503e1e471fecf6aa790109cd Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Apr 2018 15:05:46 -0500 Subject: [PATCH 2/8] Remove jetty and jetty9 provisioning. --- drupalbox/drupalbox.yml | 3 - drupalbox/tests/jetty_spec.rb | 18 - provisioning/roles/jetty/defaults/main.yml | 24 - provisioning/roles/jetty/handlers/main.yml | 7 - provisioning/roles/jetty/tasks/main.yml | 59 -- .../roles/jetty/templates/default_jetty.j2 | 14 - .../roles/jetty/templates/jetty.xml.j2 | 108 --- provisioning/roles/jetty9/defaults/main.yml | 26 - provisioning/roles/jetty9/files/jetty.sh | 617 ------------------ provisioning/roles/jetty9/handlers/main.yml | 7 - provisioning/roles/jetty9/tasks/main.yml | 66 -- .../roles/jetty9/templates/default_jetty.j2 | 14 - .../roles/jetty9/templates/jetty.xml.j2 | 108 --- 13 files changed, 1071 deletions(-) delete mode 100644 drupalbox/tests/jetty_spec.rb delete mode 100644 provisioning/roles/jetty/defaults/main.yml delete mode 100644 provisioning/roles/jetty/handlers/main.yml delete mode 100644 provisioning/roles/jetty/tasks/main.yml delete mode 100644 provisioning/roles/jetty/templates/default_jetty.j2 delete mode 100644 provisioning/roles/jetty/templates/jetty.xml.j2 delete mode 100644 provisioning/roles/jetty9/defaults/main.yml delete mode 100755 provisioning/roles/jetty9/files/jetty.sh delete mode 100644 provisioning/roles/jetty9/handlers/main.yml delete mode 100644 provisioning/roles/jetty9/tasks/main.yml delete mode 100644 provisioning/roles/jetty9/templates/default_jetty.j2 delete mode 100644 provisioning/roles/jetty9/templates/jetty.xml.j2 diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index 4111c37..928fcb3 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -6,8 +6,6 @@ rvm1_install_path: /home/vagrant/.rvm php_xdebug_enabled: true php_ini_sendmail_path: "/usr/local/bin/mhsendmail" - jetty_server_enabled: false - jetty_server_java_options: "-Xmx256m -Djava.awt.headless=true -Dsolr.solr.home=/usr/share/solr/current" solr_cores: - name: drupal7 folder: search_api_solr-7x-1.11-4.x @@ -30,7 +28,6 @@ } - { role: memcached } - { role: mailhog } - #- { role: jetty9 } #- { role: solr } - { role: apache } - { role: mysql-client } diff --git a/drupalbox/tests/jetty_spec.rb b/drupalbox/tests/jetty_spec.rb deleted file mode 100644 index c5df085..0000000 --- a/drupalbox/tests/jetty_spec.rb +++ /dev/null @@ -1,18 +0,0 @@ -require_relative 'spec_helper' - -describe user('jetty') do - it { should exist } - it { should belong_to_primary_group 'jetty' } -end - -describe package('jetty9') do - it { should be_installed } -end - -describe package('libjetty-extra') do - it { should be_installed } -end - -describe service('jetty9') do - it { should_not be_enabled } -end diff --git a/provisioning/roles/jetty/defaults/main.yml b/provisioning/roles/jetty/defaults/main.yml deleted file mode 100644 index ce00e53..0000000 --- a/provisioning/roles/jetty/defaults/main.yml +++ /dev/null @@ -1,24 +0,0 @@ ---- -jetty_packages: - - jetty - - libjetty-extra - -jetty_server_enabled: true - -jetty_server_host: 0.0.0.0 -jetty_server_port: 8983 -jetty_server_no_start: 0 -jetty_server_args: "" -jetty_server_java_options: "-Xmx256m -Djava.awt.headless=true" - -jetty_app_user: jetty -jetty_app_group: jetty -jetty_app_home: /usr/share/jetty -jetty_app_config_dir: /etc/jetty -jetty_app_default_dir: /etc/default -jetty_app_log_dir: /var/log/jetty -jetty_app_tmp_dir: /var/cache/jetty/data -jetty_app_context_dir: /etc/jetty/contexts -jetty_app_webapp_dir: /var/lib/jetty/webapps - -java_home_dir: /usr/lib/jvm/default-java diff --git a/provisioning/roles/jetty/handlers/main.yml b/provisioning/roles/jetty/handlers/main.yml deleted file mode 100644 index a5af6bf..0000000 --- a/provisioning/roles/jetty/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - - name: Jetty | Restart jetty - become: yes - service: - name: jetty - state: restarted - tags: jetty diff --git a/provisioning/roles/jetty/tasks/main.yml b/provisioning/roles/jetty/tasks/main.yml deleted file mode 100644 index 29b2e48..0000000 --- a/provisioning/roles/jetty/tasks/main.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -- name: Jetty | Add jetty group - become: yes - group: - name: "{{ jetty_app_group }}" - state: present - tags: jetty - -- name: Jetty | Add jetty user - become: yes - user: - name: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - home: "{{ jetty_app_home }}" - tags: jetty - -- name: Jetty | Install Jetty - become: yes - apt: pkg={{ item }} state=installed update_cache=yes - with_items: "{{ jetty_packages }}" - tags: jetty - -- name: Jetty | Generate Jetty default config - become: yes - template: - src: default_jetty.j2 - dest: "{{ jetty_app_default_dir }}/jetty" - owner: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - mode: 0644 - tags: jetty - -- name: Jetty | Generate jetty.xml - become: yes - template: - src: jetty.xml.j2 - dest: "{{ jetty_app_config_dir }}/jetty.xml" - owner: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - mode: 0644 - tags: jetty - -- name: Jetty | Enable Jetty Service - become: yes - service: - name: jetty - state: restarted - enabled: yes - when: jetty_server_enabled == True - tags: jetty - -- name: Jetty | Disable Jetty Service - become: yes - service: - name: jetty - state: stopped - enabled: no - when: jetty_server_enabled != True - tags: jetty diff --git a/provisioning/roles/jetty/templates/default_jetty.j2 b/provisioning/roles/jetty/templates/default_jetty.j2 deleted file mode 100644 index 801eabc..0000000 --- a/provisioning/roles/jetty/templates/default_jetty.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# Defaults for jetty see /etc/init.d/jetty for more -# -# {{ ansible_managed }} - -NO_START={{ jetty_server_no_start }} -VERBOSE=yes -JETTY_USER={{ jetty_app_user }} -JETTY_HOST={{ jetty_server_host }} -JETTY_PORT={{ jetty_server_port }} -JETTY_LOGS={{ jetty_app_log_dir }} -JETTY_ARGS={{ jetty_server_args }} -JAVA_OPTIONS="{{ jetty_server_java_options }}" -JAVA_HOME={{ java_home_dir }} -JETTY_TMP={{ jetty_app_tmp_dir }} diff --git a/provisioning/roles/jetty/templates/jetty.xml.j2 b/provisioning/roles/jetty/templates/jetty.xml.j2 deleted file mode 100644 index 4b5f27f..0000000 --- a/provisioning/roles/jetty/templates/jetty.xml.j2 +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - 10 - 200 - 20 - 2 - - - - - - - - - - - 60000 - 2 - false - 8443 - 5000 - 5000 - - - - - - - - - - - - - - - - - - - - - - - - - - - /contexts - 5 - - - - - - - - - /webapps - false - true - false - /etc/webdefault.xml - - - - - - - - - Test Realm - /etc/realm.properties - 0 - - - - - - - - - /yyyy_mm_dd.request.log - yyyy_MM_dd - 90 - true - false - false - GMT - - - - - true - true - true - 1000 - - diff --git a/provisioning/roles/jetty9/defaults/main.yml b/provisioning/roles/jetty9/defaults/main.yml deleted file mode 100644 index 1a4396b..0000000 --- a/provisioning/roles/jetty9/defaults/main.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -jetty_packages: - - default-jdk - - jetty9 - -jetty_server_enabled: true - -jetty_server_host: 0.0.0.0 -jetty_server_port: 8983 -jetty_server_no_start: 0 -jetty_server_args: "" -jetty_server_java_options: "-Xmx256m -Djava.awt.headless=true" - -jetty_service: jetty9 - -jetty_app_user: jetty -jetty_app_group: jetty -jetty_app_home: /usr/share/jetty9 -jetty_app_config_dir: /etc/jetty9 -jetty_app_default_dir: /etc/default -jetty_app_log_dir: /var/log/jetty9 -jetty_app_tmp_dir: /var/cache/jetty9/data -jetty_app_context_dir: /etc/jetty9/contexts -jetty_app_webapp_dir: /var/lib/jetty9/webapps - -java_home_dir: /usr/lib/jvm/default-java diff --git a/provisioning/roles/jetty9/files/jetty.sh b/provisioning/roles/jetty9/files/jetty.sh deleted file mode 100755 index f200375..0000000 --- a/provisioning/roles/jetty9/files/jetty.sh +++ /dev/null @@ -1,617 +0,0 @@ -#!/usr/bin/env bash - -# The version of this script distributed with Jetty 9.2.14-1 doesn't start; this -# script is copied from the Jetty 9.3.13.v20161014 distribution. - -# LSB Tags -### BEGIN INIT INFO -# Provides: jetty -# Required-Start: $local_fs $network -# Required-Stop: $local_fs $network -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Jetty start script. -# Description: Start Jetty web server. -### END INIT INFO - -# Startup script for jetty under *nix systems (it works under NT/cygwin too). - -################################################## -# Set the name which is used by other variables. -# Defaults to the file name without extension. -################################################## -NAME=$(echo $(basename $0) | sed -e 's/^[SK][0-9]*//' -e 's/\.sh$//') - -# To get the service to restart correctly on reboot, uncomment below (3 lines): -# ======================== -# chkconfig: 3 99 99 -# description: Jetty 9 webserver -# processname: jetty -# ======================== - -# Configuration files -# -# /etc/default/$NAME -# If it exists, this is read at the start of script. It may perform any -# sequence of shell commands, like setting relevant environment variables. -# -# $HOME/.$NAMErc (e.g. $HOME/.jettyrc) -# If it exists, this is read at the start of script. It may perform any -# sequence of shell commands, like setting relevant environment variables. -# -# /etc/$NAME.conf -# If found, and no configurations were given on the command line, -# the file will be used as this script's configuration. -# Each line in the file may contain: -# - A comment denoted by the pound (#) sign as first non-blank character. -# - The path to a regular file, which will be passed to jetty as a -# config.xml file. -# - The path to a directory. Each *.xml file in the directory will be -# passed to jetty as a config.xml file. -# - All other lines will be passed, as-is to the start.jar -# -# The files will be checked for existence before being passed to jetty. -# -# Configuration variables -# -# JAVA -# Command to invoke Java. If not set, java (from the PATH) will be used. -# -# JAVA_OPTIONS -# Extra options to pass to the JVM -# -# JETTY_HOME -# Where Jetty is installed. If not set, the script will try go -# guess it by looking at the invocation path for the script -# The java system property "jetty.home" will be -# set to this value for use by configure.xml files, f.e.: -# -# /webapps/jetty.war -# -# JETTY_BASE -# Where your Jetty base directory is. If not set, the value from -# $JETTY_HOME will be used. -# -# JETTY_RUN -# Where the $NAME.pid file should be stored. It defaults to the -# first available of /var/run, /usr/var/run, JETTY_BASE and /tmp -# if not set. -# -# JETTY_PID -# The Jetty PID file, defaults to $JETTY_RUN/$NAME.pid -# -# JETTY_ARGS -# The default arguments to pass to jetty. -# For example -# JETTY_ARGS=jetty.http.port=8080 jetty.ssl.port=8443 -# -# JETTY_USER -# if set, then used as a username to run the server as -# -# JETTY_SHELL -# If set, then used as the shell by su when starting the server. Will have -# no effect if start-stop-daemon exists. Useful when JETTY_USER does not -# have shell access, e.g. /bin/false -# - -usage() -{ - echo "Usage: ${0##*/} [-d] {start|stop|run|restart|check|supervise} [ CONFIGS ... ] " - exit 1 -} - -[ $# -gt 0 ] || usage - - -################################################## -# Some utility functions -################################################## -findDirectory() -{ - local L OP=$1 - shift - for L in "$@"; do - [ "$OP" "$L" ] || continue - printf %s "$L" - break - done -} - -running() -{ - if [ -f "$1" ] - then - local PID=$(cat "$1" 2>/dev/null) || return 1 - kill -0 "$PID" 2>/dev/null - return - fi - rm -f "$1" - return 1 -} - -started() -{ - # wait for 60s to see "STARTED" in PID file, needs jetty-started.xml as argument - for T in 1 2 3 4 5 6 7 9 10 11 12 13 14 15 - do - sleep 4 - [ -z "$(grep STARTED $1 2>/dev/null)" ] || return 0 - [ -z "$(grep STOPPED $1 2>/dev/null)" ] || return 1 - [ -z "$(grep FAILED $1 2>/dev/null)" ] || return 1 - local PID=$(cat "$2" 2>/dev/null) || return 1 - kill -0 "$PID" 2>/dev/null || return 1 - echo -n ". " - done - - return 1; -} - - -readConfig() -{ - (( DEBUG )) && echo "Reading $1.." - source "$1" -} - - - -################################################## -# Get the action & configs -################################################## -CONFIGS=() -NO_START=0 -DEBUG=0 - -while [[ $1 = -* ]]; do - case $1 in - -d) DEBUG=1 ;; - esac - shift -done -ACTION=$1 -shift - -################################################## -# Read any configuration files -################################################## -ETC=/etc -if [ $UID != 0 ] -then - ETC=$HOME/etc -fi - -for CONFIG in {/etc,~/etc}/default/${NAME}{,9} $HOME/.${NAME}rc; do - if [ -f "$CONFIG" ] ; then - readConfig "$CONFIG" - fi -done - - -################################################## -# Set tmp if not already set. -################################################## -TMPDIR=${TMPDIR:-/tmp} - -################################################## -# Jetty's hallmark -################################################## -JETTY_INSTALL_TRACE_FILE="start.jar" - - -################################################## -# Try to determine JETTY_HOME if not set -################################################## -if [ -z "$JETTY_HOME" ] -then - JETTY_SH=$0 - case "$JETTY_SH" in - /*) JETTY_HOME=${JETTY_SH%/*/*} ;; - ./*/*) JETTY_HOME=${JETTY_SH%/*/*} ;; - ./*) JETTY_HOME=.. ;; - */*/*) JETTY_HOME=./${JETTY_SH%/*/*} ;; - */*) JETTY_HOME=. ;; - *) JETTY_HOME=.. ;; - esac - - if [ ! -f "$JETTY_HOME/$JETTY_INSTALL_TRACE_FILE" ] - then - JETTY_HOME= - fi -fi - - -################################################## -# No JETTY_HOME yet? We're out of luck! -################################################## -if [ -z "$JETTY_HOME" ]; then - echo "** ERROR: JETTY_HOME not set, you need to set it or install in a standard location" - exit 1 -fi - -cd "$JETTY_HOME" -JETTY_HOME=$PWD - - -################################################## -# Set JETTY_BASE -################################################## -if [ -z "$JETTY_BASE" ]; then - JETTY_BASE=$JETTY_HOME -fi - -cd "$JETTY_BASE" -JETTY_BASE=$PWD - - -##################################################### -# Check that jetty is where we think it is -##################################################### -if [ ! -r "$JETTY_HOME/$JETTY_INSTALL_TRACE_FILE" ] -then - echo "** ERROR: Oops! Jetty doesn't appear to be installed in $JETTY_HOME" - echo "** ERROR: $JETTY_HOME/$JETTY_INSTALL_TRACE_FILE is not readable!" - exit 1 -fi - -################################################## -# Try to find this script's configuration file, -# but only if no configurations were given on the -# command line. -################################################## -if [ -z "$JETTY_CONF" ] -then - if [ -f $ETC/${NAME}.conf ] - then - JETTY_CONF=$ETC/${NAME}.conf - elif [ -f "$JETTY_BASE/etc/jetty.conf" ] - then - JETTY_CONF=$JETTY_BASE/etc/jetty.conf - elif [ -f "$JETTY_HOME/etc/jetty.conf" ] - then - JETTY_CONF=$JETTY_HOME/etc/jetty.conf - fi -fi - -##################################################### -# Find a location for the pid file -##################################################### -if [ -z "$JETTY_RUN" ] -then - JETTY_RUN=$(findDirectory -w /var/run /usr/var/run $JETTY_BASE /tmp) -fi - -##################################################### -# Find a pid and state file -##################################################### -if [ -z "$JETTY_PID" ] -then - JETTY_PID="$JETTY_RUN/${NAME}.pid" -fi - -if [ -z "$JETTY_STATE" ] -then - JETTY_STATE=$JETTY_BASE/${NAME}.state -fi - -case "`uname`" in -CYGWIN*) JETTY_STATE="`cygpath -w $JETTY_STATE`";; -esac - - -JETTY_ARGS=(${JETTY_ARGS[*]} "jetty.state=$JETTY_STATE") - -################################################## -# Get the list of config.xml files from jetty.conf -################################################## -if [ -f "$JETTY_CONF" ] && [ -r "$JETTY_CONF" ] -then - while read -r CONF - do - if expr "$CONF" : '#' >/dev/null ; then - continue - fi - - if [ -d "$CONF" ] - then - # assume it's a directory with configure.xml files - # for example: /etc/jetty.d/ - # sort the files before adding them to the list of JETTY_ARGS - for XMLFILE in "$CONF/"*.xml - do - if [ -r "$XMLFILE" ] && [ -f "$XMLFILE" ] - then - JETTY_ARGS=(${JETTY_ARGS[*]} "$XMLFILE") - else - echo "** WARNING: Cannot read '$XMLFILE' specified in '$JETTY_CONF'" - fi - done - else - # assume it's a command line parameter (let start.jar deal with its validity) - JETTY_ARGS=(${JETTY_ARGS[*]} "$CONF") - fi - done < "$JETTY_CONF" -fi - -################################################## -# Setup JAVA if unset -################################################## -if [ -z "$JAVA" ] -then - JAVA=$(which java) -fi - -if [ -z "$JAVA" ] -then - echo "Cannot find a Java JDK. Please set either set JAVA or put java (>=1.5) in your PATH." >&2 - exit 1 -fi - -##################################################### -# See if JETTY_LOGS is defined -##################################################### -if [ -z "$JETTY_LOGS" ] && [ -d $JETTY_BASE/logs ] -then - JETTY_LOGS=$JETTY_BASE/logs -fi -if [ -z "$JETTY_LOGS" ] && [ -d $JETTY_HOME/logs ] -then - JETTY_LOGS=$JETTY_HOME/logs -fi -if [ "$JETTY_LOGS" ] -then - - case "`uname`" in - CYGWIN*) JETTY_LOGS="`cygpath -w $JETTY_LOGS`";; - esac - - JAVA_OPTIONS=(${JAVA_OPTIONS[*]} "-Djetty.logging.dir=$JETTY_LOGS") -fi - -##################################################### -# Are we running on Windows? Could be, with Cygwin/NT. -##################################################### -case "`uname`" in -CYGWIN*) PATH_SEPARATOR=";";; -*) PATH_SEPARATOR=":";; -esac - - -##################################################### -# Add jetty properties to Java VM options. -##################################################### - -case "`uname`" in -CYGWIN*) -JETTY_HOME="`cygpath -w $JETTY_HOME`" -JETTY_BASE="`cygpath -w $JETTY_BASE`" -TMPDIR="`cygpath -w $TMPDIR`" -;; -esac - -JAVA_OPTIONS=(${JAVA_OPTIONS[*]} "-Djetty.home=$JETTY_HOME" "-Djetty.base=$JETTY_BASE" "-Djava.io.tmpdir=$TMPDIR") - -##################################################### -# This is how the Jetty server will be started -##################################################### - -JETTY_START=$JETTY_HOME/start.jar -START_INI=$JETTY_BASE/start.ini -START_D=$JETTY_BASE/start.d -if [ ! -f "$START_INI" -a ! -d "$START_D" ] -then - echo "Cannot find a start.ini file or a start.d directory in your JETTY_BASE directory: $JETTY_BASE" >&2 - exit 1 -fi - -case "`uname`" in -CYGWIN*) JETTY_START="`cygpath -w $JETTY_START`";; -esac - -RUN_ARGS=(${JAVA_OPTIONS[@]} -jar "$JETTY_START" ${JETTY_ARGS[*]}) -RUN_CMD=("$JAVA" ${RUN_ARGS[@]}) - -##################################################### -# Comment these out after you're happy with what -# the script is doing. -##################################################### -if (( DEBUG )) -then - echo "START_INI = $START_INI" - echo "START_D = $START_D" - echo "JETTY_HOME = $JETTY_HOME" - echo "JETTY_BASE = $JETTY_BASE" - echo "JETTY_CONF = $JETTY_CONF" - echo "JETTY_PID = $JETTY_PID" - echo "JETTY_START = $JETTY_START" - echo "JETTY_ARGS = ${JETTY_ARGS[*]}" - echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}" - echo "JAVA = $JAVA" - echo "RUN_CMD = ${RUN_CMD[*]}" -fi - -################################################## -# Do the action -################################################## -case "$ACTION" in - start) - echo -n "Starting Jetty: " - - if (( NO_START )); then - echo "Not starting ${NAME} - NO_START=1"; - exit - fi - - if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1 - then - unset CH_USER - if [ -n "$JETTY_USER" ] - then - CH_USER="-c$JETTY_USER" - fi - - start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_LOGS/start.log" - - else - - if running $JETTY_PID - then - echo "Already Running $(cat $JETTY_PID)!" - exit 1 - fi - - if [ -n "$JETTY_USER" ] && [ `whoami` != "$JETTY_USER" ] - then - unset SU_SHELL - if [ "$JETTY_SHELL" ] - then - SU_SHELL="-s $JETTY_SHELL" - fi - - touch "$JETTY_PID" - chown "$JETTY_USER" "$JETTY_PID" - # FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc. - su - "$JETTY_USER" $SU_SHELL -c " - exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" > /dev/null & - disown \$! - echo \$! > '$JETTY_PID'" - else - "${RUN_CMD[@]}" > /dev/null & - disown $! - echo $! > "$JETTY_PID" - fi - - fi - - if expr "${JETTY_ARGS[*]}" : '.*jetty-started.xml.*' >/dev/null - then - if started "$JETTY_STATE" "$JETTY_PID" - then - echo "OK `date`" - else - echo "FAILED `date`" - exit 1 - fi - else - echo "ok `date`" - fi - - ;; - - stop) - echo -n "Stopping Jetty: " - if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1; then - start-stop-daemon -K -p"$JETTY_PID" -d"$JETTY_HOME" -a "$JAVA" -s HUP - - TIMEOUT=30 - while running "$JETTY_PID"; do - if (( TIMEOUT-- == 0 )); then - start-stop-daemon -K -p"$JETTY_PID" -d"$JETTY_HOME" -a "$JAVA" -s KILL - fi - - sleep 1 - done - else - if [ ! -f "$JETTY_PID" ] ; then - echo "ERROR: no pid found at $JETTY_PID" - exit 1 - fi - - PID=$(cat "$JETTY_PID" 2>/dev/null) - if [ -z "$PID" ] ; then - echo "ERROR: no pid id found in $JETTY_PID" - exit 1 - fi - kill "$PID" 2>/dev/null - - TIMEOUT=30 - while running $JETTY_PID; do - if (( TIMEOUT-- == 0 )); then - kill -KILL "$PID" 2>/dev/null - fi - - sleep 1 - done - fi - - rm -f "$JETTY_PID" - rm -f "$JETTY_STATE" - echo OK - - ;; - - restart) - JETTY_SH=$0 - > "$JETTY_STATE" - if [ ! -f $JETTY_SH ]; then - if [ ! -f $JETTY_HOME/bin/jetty.sh ]; then - echo "$JETTY_HOME/bin/jetty.sh does not exist." - exit 1 - fi - JETTY_SH=$JETTY_HOME/bin/jetty.sh - fi - - "$JETTY_SH" stop "$@" - "$JETTY_SH" start "$@" - - ;; - - supervise) - # - # Under control of daemontools supervise monitor which - # handles restarts and shutdowns via the svc program. - # - exec "${RUN_CMD[@]}" - - ;; - - run|demo) - echo "Running Jetty: " - - if running "$JETTY_PID" - then - echo Already Running $(cat "$JETTY_PID")! - exit 1 - fi - - exec "${RUN_CMD[@]}" - ;; - - check|status) - if running "$JETTY_PID" - then - echo "Jetty running pid=$(< "$JETTY_PID")" - else - echo "Jetty NOT running" - fi - echo - echo "START_INI = $START_INI" - echo "START_D = $START_D" - echo "JETTY_HOME = $JETTY_HOME" - echo "JETTY_BASE = $JETTY_BASE" - echo "JETTY_CONF = $JETTY_CONF" - echo "JETTY_PID = $JETTY_PID" - echo "JETTY_START = $JETTY_START" - echo "JETTY_LOGS = $JETTY_LOGS" - echo "JETTY_STATE = $JETTY_STATE" - echo "CLASSPATH = $CLASSPATH" - echo "JAVA = $JAVA" - echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}" - echo "JETTY_ARGS = ${JETTY_ARGS[*]}" - echo "RUN_CMD = ${RUN_CMD[*]}" - echo - - if running "$JETTY_PID" - then - exit 0 - fi - exit 1 - - ;; - - *) - usage - - ;; -esac - -exit 0 diff --git a/provisioning/roles/jetty9/handlers/main.yml b/provisioning/roles/jetty9/handlers/main.yml deleted file mode 100644 index 684f21a..0000000 --- a/provisioning/roles/jetty9/handlers/main.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- - - name: Jetty | Restart jetty - become: yes - service: - name: "{{ jetty_service }}" - state: restarted - tags: jetty9 diff --git a/provisioning/roles/jetty9/tasks/main.yml b/provisioning/roles/jetty9/tasks/main.yml deleted file mode 100644 index 3e83af5..0000000 --- a/provisioning/roles/jetty9/tasks/main.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -- name: Jetty | Add jetty group - become: yes - group: - name: "{{ jetty_app_group }}" - state: present - tags: jetty9 - -- name: Jetty | Add Jetty user - become: yes - user: - name: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - home: "{{ jetty_app_home }}" - tags: jetty9 - -- name: Jetty | Install Jetty - become: yes - apt: pkg={{ item }} state=installed update_cache=yes - with_items: "{{ jetty_packages }}" - tags: jetty9 - -- name: Jetty | Generate Jetty default config - become: yes - template: - src: default_jetty.j2 - dest: "{{ jetty_app_default_dir }}/jetty" - owner: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - mode: 0644 - tags: jetty9 - -- name: Jetty | Generate jetty.xml - become: yes - template: - src: jetty.xml.j2 - dest: "{{ jetty_app_config_dir }}/jetty.xml" - owner: "{{ jetty_app_user }}" - group: "{{ jetty_app_group }}" - mode: 0644 - tags: jetty9 - -- name: Jetty | Install updated Jetty service - become: yes - copy: - src: jetty.sh - dest: /etc/init.d/jetty9 - mode: 0755 - -- name: Jetty | Enable Jetty Service - become: yes - service: - name: "{{ jetty_service }}" - state: restarted - enabled: yes - when: jetty_server_enabled == True - tags: jetty9 - -- name: Jetty | Disable Jetty Service - become: yes - service: - name: "{{ jetty_service }}" - state: stopped - enabled: no - when: jetty_server_enabled != True - tags: jetty9 diff --git a/provisioning/roles/jetty9/templates/default_jetty.j2 b/provisioning/roles/jetty9/templates/default_jetty.j2 deleted file mode 100644 index 801eabc..0000000 --- a/provisioning/roles/jetty9/templates/default_jetty.j2 +++ /dev/null @@ -1,14 +0,0 @@ -# Defaults for jetty see /etc/init.d/jetty for more -# -# {{ ansible_managed }} - -NO_START={{ jetty_server_no_start }} -VERBOSE=yes -JETTY_USER={{ jetty_app_user }} -JETTY_HOST={{ jetty_server_host }} -JETTY_PORT={{ jetty_server_port }} -JETTY_LOGS={{ jetty_app_log_dir }} -JETTY_ARGS={{ jetty_server_args }} -JAVA_OPTIONS="{{ jetty_server_java_options }}" -JAVA_HOME={{ java_home_dir }} -JETTY_TMP={{ jetty_app_tmp_dir }} diff --git a/provisioning/roles/jetty9/templates/jetty.xml.j2 b/provisioning/roles/jetty9/templates/jetty.xml.j2 deleted file mode 100644 index 4b5f27f..0000000 --- a/provisioning/roles/jetty9/templates/jetty.xml.j2 +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - 10 - 200 - 20 - 2 - - - - - - - - - - - 60000 - 2 - false - 8443 - 5000 - 5000 - - - - - - - - - - - - - - - - - - - - - - - - - - - /contexts - 5 - - - - - - - - - /webapps - false - true - false - /etc/webdefault.xml - - - - - - - - - Test Realm - /etc/realm.properties - 0 - - - - - - - - - /yyyy_mm_dd.request.log - yyyy_MM_dd - 90 - true - false - false - GMT - - - - - true - true - true - 1000 - - From 08b311b1501b2acf9d4ebd5838a182b2810f8573 Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Apr 2018 15:17:01 -0500 Subject: [PATCH 3/8] Remove old solr role. --- drupalbox/drupalbox.yml | 6 - provisioning/roles/solr/defaults/main.yml | 22 - .../conf/elevate.xml | 31 - .../conf/mapping-ISOLatin1Accent.txt | 14 - .../conf/protwords.txt | 7 - .../conf/schema.xml | 594 ------ .../conf/schema_extra_fields.xml | 23 - .../conf/schema_extra_types.xml | 30 - .../conf/solrconfig.xml | 1641 ----------------- .../conf/solrconfig_extra.xml | 80 - .../conf/solrcore.properties | 20 - .../conf/stopwords.txt | 4 - .../conf/synonyms.txt | 3 - .../conf/elevate.xml | 31 - .../conf/mapping-ISOLatin1Accent.txt | 14 - .../conf/protwords.txt | 7 - .../conf/schema.xml | 552 ------ .../conf/schema_extra_fields.xml | 23 - .../conf/schema_extra_types.xml | 30 - .../conf/solrconfig.xml | 1633 ---------------- .../conf/solrconfig_extra.xml | 80 - .../conf/solrcore.properties | 20 - .../conf/stopwords.txt | 4 - .../conf/synonyms.txt | 3 - provisioning/roles/solr/tasks/cores.yml | 31 - provisioning/roles/solr/tasks/init.yml | 22 - provisioning/roles/solr/tasks/install.yml | 73 - provisioning/roles/solr/tasks/main.yml | 12 - provisioning/roles/solr/templates/solr.xml.j2 | 9 - 29 files changed, 5019 deletions(-) delete mode 100644 provisioning/roles/solr/defaults/main.yml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/elevate.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/mapping-ISOLatin1Accent.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/protwords.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_fields.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_types.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig_extra.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrcore.properties delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/stopwords.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/synonyms.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/elevate.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/mapping-ISOLatin1Accent.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/protwords.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_fields.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_types.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig_extra.xml delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrcore.properties delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/stopwords.txt delete mode 100644 provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/synonyms.txt delete mode 100644 provisioning/roles/solr/tasks/cores.yml delete mode 100644 provisioning/roles/solr/tasks/init.yml delete mode 100644 provisioning/roles/solr/tasks/install.yml delete mode 100644 provisioning/roles/solr/tasks/main.yml delete mode 100644 provisioning/roles/solr/templates/solr.xml.j2 diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index 928fcb3..351be14 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -6,11 +6,6 @@ rvm1_install_path: /home/vagrant/.rvm php_xdebug_enabled: true php_ini_sendmail_path: "/usr/local/bin/mhsendmail" - solr_cores: - - name: drupal7 - folder: search_api_solr-7x-1.11-4.x - - name: drupal8 - folder: search_api_solr-8x-1.0-alpha5-4.x vars_files: - vars/default/common.yml - vars/dev/mysql.yml @@ -28,7 +23,6 @@ } - { role: memcached } - { role: mailhog } - #- { role: solr } - { role: apache } - { role: mysql-client } - { role: mysql-server } diff --git a/provisioning/roles/solr/defaults/main.yml b/provisioning/roles/solr/defaults/main.yml deleted file mode 100644 index ac9c05f..0000000 --- a/provisioning/roles/solr/defaults/main.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -solr_mirror: https://archive.apache.org/dist/lucene/solr/ -solr_version: 4.5.1 - -slf4j_lib_path: "{{ solr_version_src_dir }}/example/lib/ext" - -solr_app_name: solr - -solr_root_src_dir: /usr/local/src/solr -solr_root_dir: /usr/share/solr -solr_home_dir: "{{ solr_root_dir }}/{{ solr_version }}" -solr_data_dir: /var/lib/solr - -solr_version_dir: solr-{{ solr_version }} -solr_version_war: solr-{{ solr_version }} -solr_version_file: "{{ solr_version_dir }}.tgz" -solr_version_src_dir: "{{ solr_root_src_dir }}/{{ solr_version_dir }}" - -solr_app_user: jetty -solr_app_group: jetty - -solr_cores: [] diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/elevate.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/elevate.xml deleted file mode 100644 index 71ea000..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/elevate.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/mapping-ISOLatin1Accent.txt b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/mapping-ISOLatin1Accent.txt deleted file mode 100644 index b92d03c..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/mapping-ISOLatin1Accent.txt +++ /dev/null @@ -1,14 +0,0 @@ -# This file contains character mappings for the default fulltext field type. -# The source characters (on the left) will be replaced by the respective target -# characters before any other processing takes place. -# Lines starting with a pound character # are ignored. -# -# For sensible defaults, use the mapping-ISOLatin1Accent.txt file distributed -# with the example application of your Solr version. -# -# Examples: -# "À" => "A" -# "\u00c4" => "A" -# "\u00c4" => "\u0041" -# "æ" => "ae" -# "\n" => " " diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/protwords.txt b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/protwords.txt deleted file mode 100644 index cda8581..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/protwords.txt +++ /dev/null @@ -1,7 +0,0 @@ -#----------------------------------------------------------------------- -# This file blocks words from being operated on by the stemmer and word delimiter. -& -< -> -' -" diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema.xml deleted file mode 100644 index 6d9011a..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema.xml +++ /dev/null @@ -1,594 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - content - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_fields.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_fields.xml deleted file mode 100644 index 9ecd5f4..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_fields.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_types.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_types.xml deleted file mode 100644 index e82072e..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/schema_extra_types.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig.xml deleted file mode 100644 index 151d9a4..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig.xml +++ /dev/null @@ -1,1641 +0,0 @@ - - - - - - - - - ${solr.abortOnConfigurationError:true} - - - ${solr.luceneMatchVersion:LUCENE_40} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - 4 - - 32 - - - - 2147483647 - 100000 - 1000 - - - - - - - - - single - - - - - - false - - - true - - - - - 1 - - 0 - - - - - - false - - - - - - - - - - - - - - - - ${solr.autoCommit.MaxDocs:10000} - ${solr.autoCommit.MaxTime:120000} - - - - - ${solr.autoSoftCommit.MaxDocs:2000} - ${solr.autoSoftCommit.MaxTime:10000} - - - - - - - - - ${solr.data.dir:} - - - - - - - - - - - - - 1024 - - - - - - - - - - - - - - - - - - - - - - true - - - - - - 20 - - - 200 - - - - - - - - - - - - solr rocks010 - - - - - - false - - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - edismax - explicit - true - 0.01 - - ${solr.pinkPony.timeAllowed:-1} - *:* - - - false - - true - false - - 1 - - - spellcheck - elevator - - - - - - - 1 - 1 - 3 - 15 - 20 - false - - ${solr.mlt.timeAllowed:2000} - - - - - - - explicit - true - - - - - - - - - - - - - - - - - - - - - - text - true - ignored_ - - - true - links - ignored_ - - - - - - - - - - - - - - - - - - - - - - - - pinkPony - solrpingquery - false - - - all - - - - - - - - - explicit - true - - - - - - - ${solr.replication.master:false} - commit - startup - ${solr.replication.confFiles:schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml} - - - ${solr.replication.slave:false} - ${solr.replication.masterUrl:http://localhost:8983/solr}/replication - ${solr.replication.pollInterval:00:00:60} - - - - - - - true - json - true - - - - - - - - - false - false - 1 - - - spellcheck - - - - - - - - - - true - - - tvComponent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - terms - - - - - - - - string - elevate.xml - - - - - - explicit - - - elevator - - - - - - - - - - - 100 - - - - - - - - 70 - - 0.5 - - [-\w ,/\n\"']{20,200} - - - - - - - ]]> - ]]> - - - - - - - - - - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - 10 - .,!? - - - - - - - WORD - - - en - US - - - - - - - - - - - - - - - - - - - text/plain; charset=UTF-8 - - - - - - - - - - 5 - - - - - - - - - - - - - *:* - - - - - - - - - - - - textSpell - - - - default - spell - spellchecker - true - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig_extra.xml b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig_extra.xml deleted file mode 100644 index c5bc3ac..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrconfig_extra.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - -textSpell - - - - - - default - spell - spellchecker - true - - - - - - - - - - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrcore.properties b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrcore.properties deleted file mode 100644 index d8edfae..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/solrcore.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Defines Solr properties for this specific core. -solr.replication.master=false -solr.replication.slave=false -solr.replication.pollInterval=00:00:60 -solr.replication.masterUrl=http://localhost:8983/solr -solr.replication.confFiles=schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml -solr.mlt.timeAllowed=2000 -# You should not set your luceneMatchVersion to anything lower than your Solr -# Version. -solr.luceneMatchVersion=LUCENE_40 -solr.pinkPony.timeAllowed=-1 -# autoCommit after 10000 docs -solr.autoCommit.MaxDocs=10000 -# autoCommit after 2 minutes -solr.autoCommit.MaxTime=120000 -# autoSoftCommit after 2000 docs -solr.autoSoftCommit.MaxDocs=2000 -# autoSoftCommit after 10 seconds -solr.autoSoftCommit.MaxTime=10000 -solr.contrib.dir=../../contrib diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/stopwords.txt b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/stopwords.txt deleted file mode 100644 index d7f243e..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/stopwords.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Contains words which shouldn't be indexed for fulltext fields, e.g., because -# they're too common. For documentation of the format, see -# http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.StopFilterFactory -# (Lines starting with a pound character # are ignored.) diff --git a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/synonyms.txt b/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/synonyms.txt deleted file mode 100644 index 7d22eea..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-7x-1.11-4.x/conf/synonyms.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Contains synonyms to use for your index. For the format used, see -# http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory -# (Lines starting with a pound character # are ignored.) diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/elevate.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/elevate.xml deleted file mode 100644 index 71ea000..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/elevate.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/mapping-ISOLatin1Accent.txt b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/mapping-ISOLatin1Accent.txt deleted file mode 100644 index b92d03c..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/mapping-ISOLatin1Accent.txt +++ /dev/null @@ -1,14 +0,0 @@ -# This file contains character mappings for the default fulltext field type. -# The source characters (on the left) will be replaced by the respective target -# characters before any other processing takes place. -# Lines starting with a pound character # are ignored. -# -# For sensible defaults, use the mapping-ISOLatin1Accent.txt file distributed -# with the example application of your Solr version. -# -# Examples: -# "À" => "A" -# "\u00c4" => "A" -# "\u00c4" => "\u0041" -# "æ" => "ae" -# "\n" => " " diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/protwords.txt b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/protwords.txt deleted file mode 100644 index cda8581..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/protwords.txt +++ /dev/null @@ -1,7 +0,0 @@ -#----------------------------------------------------------------------- -# This file blocks words from being operated on by the stemmer and word delimiter. -& -< -> -' -" diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema.xml deleted file mode 100644 index b2c566a..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema.xml +++ /dev/null @@ -1,552 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id - - - content - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_fields.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_fields.xml deleted file mode 100644 index 9ecd5f4..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_fields.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_types.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_types.xml deleted file mode 100644 index e82072e..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/schema_extra_types.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig.xml deleted file mode 100644 index f26982f..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig.xml +++ /dev/null @@ -1,1633 +0,0 @@ - - - - - - - - - ${solr.abortOnConfigurationError:true} - - - ${solr.luceneMatchVersion:LUCENE_40} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - false - - 4 - - 32 - - - - 2147483647 - 100000 - 1000 - - - - - - - - - single - - - - - - false - - - true - - - - - 1 - - 0 - - - - - - false - - - - - - - - - - - - - - - - ${solr.autoCommit.MaxDocs:10000} - ${solr.autoCommit.MaxTime:120000} - - - - - ${solr.autoSoftCommit.MaxDocs:2000} - ${solr.autoSoftCommit.MaxTime:10000} - - - - - - - - - ${solr.data.dir:} - - - - - - - - - - - - - 1024 - - - - - - - - - - - - - - - - - - - - - - true - - - - - - 20 - - - 200 - - - - - - - - - - - - solr rocks010 - - - - - - false - - - 2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - edismax - explicit - true - 0.01 - - ${solr.pinkPony.timeAllowed:-1} - *:* - - - false - - true - false - - 1 - - - spellcheck - - - - - - - 1 - 1 - 3 - 15 - 20 - false - - ${solr.mlt.timeAllowed:2000} - - - - - - - explicit - true - - - - - - - - - - - - - - - - - - - - - - text - true - ignored_ - - - true - links - ignored_ - - - - - - - - - - - - - - - - - - - - - - - - pinkPony - solrpingquery - - - all - - - - - - - explicit - true - - - - - - - ${solr.replication.master:false} - commit - startup - ${solr.replication.confFiles:schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml} - - - ${solr.replication.slave:false} - ${solr.replication.masterUrl:http://localhost:8983/solr}/replication - ${solr.replication.pollInterval:00:00:60} - - - - - - - true - json - true - - - - - - - - - false - false - 1 - - - spellcheck - - - - - - - - - - true - - - tvComponent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - terms - - - - - - - - string - elevate.xml - - - - - - explicit - - - elevator - - - - - - - - - - - 100 - - - - - - - - 70 - - 0.5 - - [-\w ,/\n\"']{20,200} - - - - - - - ]]> - ]]> - - - - - - - - - - - - - - - - - - - - - ,, - ,, - ,, - ,, - ,]]> - ]]> - - - - - - 10 - .,!? - - - - - - - WORD - - - en - US - - - - - - - - - - - - - - - - - - - text/plain; charset=UTF-8 - - - - - - - - - - 5 - - - - - - - - - - - - - *:* - - - - - - - - - - - - textSpell - - - - default - spell - spellchecker - true - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig_extra.xml b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig_extra.xml deleted file mode 100644 index c5bc3ac..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrconfig_extra.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - -textSpell - - - - - - default - spell - spellchecker - true - - - - - - - - - - - - - - - diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrcore.properties b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrcore.properties deleted file mode 100644 index d8edfae..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/solrcore.properties +++ /dev/null @@ -1,20 +0,0 @@ -# Defines Solr properties for this specific core. -solr.replication.master=false -solr.replication.slave=false -solr.replication.pollInterval=00:00:60 -solr.replication.masterUrl=http://localhost:8983/solr -solr.replication.confFiles=schema.xml,mapping-ISOLatin1Accent.txt,protwords.txt,stopwords.txt,synonyms.txt,elevate.xml -solr.mlt.timeAllowed=2000 -# You should not set your luceneMatchVersion to anything lower than your Solr -# Version. -solr.luceneMatchVersion=LUCENE_40 -solr.pinkPony.timeAllowed=-1 -# autoCommit after 10000 docs -solr.autoCommit.MaxDocs=10000 -# autoCommit after 2 minutes -solr.autoCommit.MaxTime=120000 -# autoSoftCommit after 2000 docs -solr.autoSoftCommit.MaxDocs=2000 -# autoSoftCommit after 10 seconds -solr.autoSoftCommit.MaxTime=10000 -solr.contrib.dir=../../contrib diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/stopwords.txt b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/stopwords.txt deleted file mode 100644 index d7f243e..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/stopwords.txt +++ /dev/null @@ -1,4 +0,0 @@ -# Contains words which shouldn't be indexed for fulltext fields, e.g., because -# they're too common. For documentation of the format, see -# http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.StopFilterFactory -# (Lines starting with a pound character # are ignored.) diff --git a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/synonyms.txt b/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/synonyms.txt deleted file mode 100644 index 7d22eea..0000000 --- a/provisioning/roles/solr/files/cores/search_api_solr-8x-1.0-alpha5-4.x/conf/synonyms.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Contains synonyms to use for your index. For the format used, see -# http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.SynonymFilterFactory -# (Lines starting with a pound character # are ignored.) diff --git a/provisioning/roles/solr/tasks/cores.yml b/provisioning/roles/solr/tasks/cores.yml deleted file mode 100644 index 4224e28..0000000 --- a/provisioning/roles/solr/tasks/cores.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- - -- name: Solr | Copy cores - become: yes - copy: - src: "cores/{{ item.folder }}" - dest: "{{ solr_home_dir }}/cores" - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - with_items: "{{ solr_cores }}" - tags: solr - -- name: Solr | Create Data Directories - become: yes - file: - path: "{{ solr_data_dir }}/{{ item.folder }}/data" - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - recurse: true - state: directory - with_items: "{{ solr_cores }}" - tags: solr - -- name: Solr | Generate solr.xml - become: yes - template: - src: solr.xml.j2 - dest: "{{ solr_home_dir }}/solr.xml" - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - tags: solr diff --git a/provisioning/roles/solr/tasks/init.yml b/provisioning/roles/solr/tasks/init.yml deleted file mode 100644 index f76029f..0000000 --- a/provisioning/roles/solr/tasks/init.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- - -- name: Solr | Create Solr Directories - become: yes - file: - path: "{{ item }}" - state: directory - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - with_items: - - "{{ solr_root_src_dir }}" - - "{{ solr_home_dir }}" - - "{{ solr_data_dir }}" - - "{{ solr_home_dir }}/cores" - tags: solr - -- name: Solr | Check download exists - become: yes - stat: - path: "{{ solr_root_src_dir }}/{{ solr_version_file }}" - register: solr_src_file_exists - tags: solr diff --git a/provisioning/roles/solr/tasks/install.yml b/provisioning/roles/solr/tasks/install.yml deleted file mode 100644 index 66ff196..0000000 --- a/provisioning/roles/solr/tasks/install.yml +++ /dev/null @@ -1,73 +0,0 @@ ---- - -- name: Solr | Check src extracted - become: yes - stat: - path: "{{ solr_version_src_dir }}" - register: solr_src_extracted - tags: solr - -- name: Solr | Download Solr - become: yes - get_url: - url: "{{ solr_mirror }}/{{ solr_version }}/{{ solr_version_file }}" - dest: "{{ solr_root_src_dir }}/{{ solr_version_file }}" - when: solr_src_file_exists.stat.exists == False - tags: solr - -- name: Solr | Extract source - become: yes - unarchive: - src: "{{ solr_root_src_dir }}/{{ solr_version_file }}" - dest: "{{ solr_root_src_dir }}" - copy: no - when: solr_src_extracted.stat.exists == False - tags: solr - -- name: Solr | Unzip war - become: yes - unarchive: - src: "{{ solr_version_src_dir }}/dist/{{ solr_version_war }}.war" - dest: "{{ solr_home_dir }}" - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - copy: no - tags: solr - -- name: Solr | Link to current - become: yes - file: - src: "{{ solr_home_dir }}" - dest: "{{ solr_root_dir }}/current" - state: link - force: yes - tags: solr - -- name: Solr | Copy logging libraries - become: yes - shell: "cp {{ slf4j_lib_path }}/* {{ solr_home_dir }}/WEB-INF/lib" - tags: solr - -- name: Solr | Copy contrib libraries - become: yes - shell: "cp -R {{ solr_version_src_dir }}/contrib {{ solr_home_dir }}/" - tags: solr - -- name: Solr | Fix directory ownership - become: yes - file: - path: "{{ solr_home_dir }}" - recurse: yes - state: directory - owner: "{{ solr_app_user }}" - group: "{{ solr_app_group }}" - tags: solr - -- name: Solr | Link to Jetty - become: yes - file: - src: "{{ solr_root_dir }}/current" - dest: "{{ jetty_app_webapp_dir }}/{{ solr_app_name }}" - state: link - force: yes - tags: solr diff --git a/provisioning/roles/solr/tasks/main.yml b/provisioning/roles/solr/tasks/main.yml deleted file mode 100644 index 97e7840..0000000 --- a/provisioning/roles/solr/tasks/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- include: init.yml -- include: install.yml -- include: cores.yml - -- name: Solr | Restart Jetty - become: yes - service: - name: jetty - state: restarted - when: jetty_server_enabled == True - tags: solr diff --git a/provisioning/roles/solr/templates/solr.xml.j2 b/provisioning/roles/solr/templates/solr.xml.j2 deleted file mode 100644 index 08154d9..0000000 --- a/provisioning/roles/solr/templates/solr.xml.j2 +++ /dev/null @@ -1,9 +0,0 @@ - - - {% for core in solr_cores -%} - - - {%- endfor %} - - - From d06b916d40424c3988f949d7035bf40d3f1813dc Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Apr 2018 15:23:33 -0500 Subject: [PATCH 4/8] Use geerlingguy.java and .solr roles from Ansible galaxy; update solr tests. --- dev/Vagrantfile | 1 + drupalbox/drupalbox.json | 1 + drupalbox/drupalbox.yml | 13 +++++++++ drupalbox/requirements.yml | 7 +++++ drupalbox/tests/solr_spec.rb | 21 ++++++++++---- provisioning/roles/.gitignore | 2 ++ .../geerlingguy.solr-cleanup/tasks/main.yml | 28 +++++++++++++++++++ .../templates/solr4.unit.j2 | 13 +++++++++ 8 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 drupalbox/requirements.yml create mode 100644 provisioning/roles/.gitignore create mode 100644 provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml create mode 100644 provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 diff --git a/dev/Vagrantfile b/dev/Vagrantfile index 504b1b7..81764ea 100644 --- a/dev/Vagrantfile +++ b/dev/Vagrantfile @@ -33,6 +33,7 @@ Vagrant.configure("2") do |config| config.vm.provision "ansible", type: :ansible do |ansible| ansible.playbook = "../#{box_name}/#{box_name}.yml" + ansible.galaxy_role_file = "../#{box_name}/requirements.yml" ansible.groups = { "#{box_name}" => "default", } diff --git a/drupalbox/drupalbox.json b/drupalbox/drupalbox.json index 52748be..9a71b3c 100644 --- a/drupalbox/drupalbox.json +++ b/drupalbox/drupalbox.json @@ -190,6 +190,7 @@ "type": "ansible-local", "playbook_dir": "provisioning", "playbook_file": "drupalbox/drupalbox.yml", + "galaxy_file": "drupalbox/requirements.yml", "inventory_groups": "drupalbox,all" }, { diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index 351be14..ffd5b46 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -23,6 +23,19 @@ } - { role: memcached } - { role: mailhog } + - { + role: geerlingguy.java, + become: yes + } + - { + role: geerlingguy.solr, + solr_version: "4.5.1", + become: yes + } + - { + role: geerlingguy.solr-cleanup, + become: yes + } - { role: apache } - { role: mysql-client } - { role: mysql-server } diff --git a/drupalbox/requirements.yml b/drupalbox/requirements.yml new file mode 100644 index 0000000..fe6e6d8 --- /dev/null +++ b/drupalbox/requirements.yml @@ -0,0 +1,7 @@ +--- + +- src: geerlingguy.java + version: 1.7.7 + +- src: geerlingguy.solr + version: 4.0.2 diff --git a/drupalbox/tests/solr_spec.rb b/drupalbox/tests/solr_spec.rb index 127398c..33d7a92 100644 --- a/drupalbox/tests/solr_spec.rb +++ b/drupalbox/tests/solr_spec.rb @@ -1,13 +1,24 @@ require_relative 'spec_helper.rb' -describe file("/usr/share/solr") do +describe file("/opt/solr") do it { should be_directory } end -describe file("/usr/share/solr/current") do - it { should be_symlink } +describe file("/var/log/solr.log") do + it { should be_file } + it { should be_owned_by 'solr' } + it { should be_grouped_into 'adm' } end -describe file("/var/lib/jetty9/webapps/solr") do - it { should be_symlink } +describe service('solr') do + it { should be_enabled } + it { should be_running } +end + +describe port(8983) do + it { should be_listening } +end + +describe command('curl http://127.0.0.1:8983/solr/admin/info/system?wt=json') do + its(:stdout) { should match /"solr-spec-version":"4\.5\.1"/ } end diff --git a/provisioning/roles/.gitignore b/provisioning/roles/.gitignore new file mode 100644 index 0000000..9d94b2b --- /dev/null +++ b/provisioning/roles/.gitignore @@ -0,0 +1,2 @@ +geerlingguy.java +geerlingguy.solr diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml new file mode 100644 index 0000000..eeb2431 --- /dev/null +++ b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- name: Solr Cleanup | Replace systemd script for Solr 4 + template: + src: solr4.unit.j2 + dest: /etc/systemd/system/solr.service + owner: root + group: root + mode: 0755 + +- name: Solr Cleanup | Fix log permissions + file: + path: /var/log/solr.log + owner: solr + group: adm + +- name: Solr Cleanup | Reload daemon + shell: systemctl daemon-reload + +- name: Solr Cleanup | Restart Solr + service: + name: solr + state: restarted + enabled: no + +- name: Solr Cleanup | Enable Solr start on boot + service: + name: solr + enabled: yes diff --git a/provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 b/provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 new file mode 100644 index 0000000..0a31279 --- /dev/null +++ b/provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 @@ -0,0 +1,13 @@ +[Unit] +Description=Apache SOLR +After=syslog.target network.target remote-fs.target nss-lookup.target + +[Service] +Type=simple +WorkingDirectory=/opt/solr/example +ExecStart=/usr/bin/java -jar -Dsolr.solr.home=/var/solr -Djetty.host=0.0.0.0 -Djetty.port=8983 -Xms256M -Xmx512M start.jar +Restart=on-failure +User=solr + +[Install] +WantedBy=multi-user.target From d21768bb4bb1e8876c433fc7598f7f6f3c476f64 Mon Sep 17 00:00:00 2001 From: Bec White Date: Wed, 4 Apr 2018 18:16:27 -0500 Subject: [PATCH 5/8] Update docs for solr fixes. --- drupalbox/CHANGELOG-0.0.md | 6 ++++-- drupalbox/README.md | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drupalbox/CHANGELOG-0.0.md b/drupalbox/CHANGELOG-0.0.md index d0e3133..6f0046c 100644 --- a/drupalbox/CHANGELOG-0.0.md +++ b/drupalbox/CHANGELOG-0.0.md @@ -6,9 +6,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added -### Fixed +- Removed Jetty in favor of Solr's bundled HTTP server +- Switched to the `geerlingguy.java` and `geerlingguy.solr` Ansible roles +- Updated serverspec tests for Solr -- Fixed the Jetty9 service +### Fixed ## [1.1.0] - 2017-11-09 diff --git a/drupalbox/README.md b/drupalbox/README.md index db00054..e5916c5 100644 --- a/drupalbox/README.md +++ b/drupalbox/README.md @@ -14,10 +14,12 @@ ### Mailhog -Mailhog's smtp service listens on port 1025, and its http service listens on port 8025; you can find the web UI at `http://yoursite.local:8025` +Mailhog's smtp service listens on port `1025`, and its http service listens on port `8025`; you can find the web UI at `http://yoursite.local:8025` ### Solr -Solr is installed to `/usr/share/solr/current` with two default cores, `drupal7` and `drupal8`. Solr runs on port 8983, and the web UI can be found at `http://yoursite.local:8983/solr`. +This box runs Solr v4.5.1, to match one of the versions available on [Acquia](https://docs.acquia.com/article/how-test-custom-solr-schema-file-locally). -In order to use it, you need to start Jetty, which can be managed with [palantirnet/the-vagrant](https://github.com/palantirnet/the-vagrant) in the `Vagrantfile`. +Solr is installed to `/opt/solr` with two default cores, `drupal7` and `drupal8`. Solr runs on port `8983`, and the web UI can be found at `http://yoursite.local:8983/solr`. + +The Solr service runs by default; when you're using [palantirnet/the-vagrant](https://github.com/palantirnet/the-vagrant), this can be managed in the `Vagrantfile`. From 2ce727b33328d2b444edcbc9f86a4c79bf52ebd7 Mon Sep 17 00:00:00 2001 From: Bec White Date: Thu, 5 Apr 2018 14:40:57 -0500 Subject: [PATCH 6/8] Download drupal/search_api_solr to get core configuration files. --- .../roles/geerlingguy.solr-cleanup/tasks/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml index eeb2431..983377b 100644 --- a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml +++ b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml @@ -26,3 +26,13 @@ service: name: solr enabled: yes + +- name: Solr Cleanup | Download Solr configuration for Drupal 7 + get_url: + url: https://ftp.drupal.org/files/projects/search_api_solr-7.x-1.12.tar.gz + dest: /tmp/search_api_solr-7.x-1.12.tar.gz + +- name: Solr Cleanup | Download Solr configuration for Drupal 8 + get_url: + url: https://ftp.drupal.org/files/projects/search_api_solr-8.x-1.2.tar.gz + dest: /tmp/search_api_solr-8.x-1.2.tar.gz From 6fdde98a6940a881c0c67fc14d8fc47f203ba10a Mon Sep 17 00:00:00 2001 From: Bec White Date: Thu, 5 Apr 2018 15:06:26 -0500 Subject: [PATCH 7/8] Create core directories and config. --- drupalbox/drupalbox.yml | 7 +++ .../geerlingguy.solr-cleanup/tasks/cores.yml | 51 +++++++++++++++++++ .../geerlingguy.solr-cleanup/tasks/main.yml | 10 +--- .../templates/core.properties.j2 | 1 + 4 files changed, 60 insertions(+), 9 deletions(-) create mode 100644 provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml create mode 100644 provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index ffd5b46..60d1c2d 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -6,6 +6,13 @@ rvm1_install_path: /home/vagrant/.rvm php_xdebug_enabled: true php_ini_sendmail_path: "/usr/local/bin/mhsendmail" + solr_cores: + - name: drupal7 + module: search_api_solr-7.x-1.12 + subdir: solr-conf/4.x + - name: drupal8 + module: search_api_solr-8.x-1.2 + subdir: solr-conf/4.x vars_files: - vars/default/common.yml - vars/dev/mysql.yml diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml b/provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml new file mode 100644 index 0000000..8d4ca79 --- /dev/null +++ b/provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml @@ -0,0 +1,51 @@ +--- + +- name: Solr | Create core directories + file: + path: "/var/solr/{{ item.name }}" + state: directory + owner: solr + group: solr + with_items: "{{ solr_cores }}" + +- name: Solr | Create data directories + file: + path: "/var/solr/{{ item.name }}/data" + state: directory + owner: solr + group: solr + with_items: "{{ solr_cores }}" + +- name: Solr | Create core.properties + template: + src: core.properties.j2 + dest: "/var/solr/{{ item.name }}/core.properties" + owner: solr + group: solr + with_items: "{{ solr_cores }}" + +- name: Solr | Download Drupal Solr configuration + get_url: + url: "https://ftp.drupal.org/files/projects/{{ item.module }}.tar.gz" + dest: "/var/solr/{{ item.name }}/{{ item.module }}.tar.gz" + with_items: "{{ solr_cores }}" + +- name: Solr | Unarchive Drupal Solr configuration + unarchive: + remote_src: yes + src: "/var/solr/{{ item.name }}/{{ item.module }}.tar.gz" + dest: "/var/solr/{{ item.name }}/" + with_items: "{{ solr_cores }}" + +- name: Solr | Copy Drupal Solr conf directory into place + command: "cp -r /var/solr/{{ item.name }}/search_api_solr/{{ item.subdir }} /var/solr/{{ item.name }}/conf" + with_items: "{{ solr_cores }}" + +- name: Solr | Chmod Solr conf directory + file: + path: "/var/solr/{{ item.name }}/conf" + state: directory + owner: solr + group: solr + recurse: yes + with_items: "{{ solr_cores }}" diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml index 983377b..bffcb93 100644 --- a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml +++ b/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml @@ -27,12 +27,4 @@ name: solr enabled: yes -- name: Solr Cleanup | Download Solr configuration for Drupal 7 - get_url: - url: https://ftp.drupal.org/files/projects/search_api_solr-7.x-1.12.tar.gz - dest: /tmp/search_api_solr-7.x-1.12.tar.gz - -- name: Solr Cleanup | Download Solr configuration for Drupal 8 - get_url: - url: https://ftp.drupal.org/files/projects/search_api_solr-8.x-1.2.tar.gz - dest: /tmp/search_api_solr-8.x-1.2.tar.gz +- include: cores.yml diff --git a/provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 b/provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 new file mode 100644 index 0000000..256498e --- /dev/null +++ b/provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 @@ -0,0 +1 @@ +name={{ item.name }} From bb3ae0b46d0fb7206920fd4a3c32f3be8c476abd Mon Sep 17 00:00:00 2001 From: Bec White Date: Thu, 5 Apr 2018 18:17:24 -0500 Subject: [PATCH 8/8] Rename solr configuration role. --- drupalbox/drupalbox.yml | 2 +- .../tasks/cores.yml | 0 .../tasks/main.yml | 0 .../templates/core.properties.j2 | 0 .../templates/solr4.unit.j2 | 0 5 files changed, 1 insertion(+), 1 deletion(-) rename provisioning/roles/{geerlingguy.solr-cleanup => solr-configuration}/tasks/cores.yml (100%) rename provisioning/roles/{geerlingguy.solr-cleanup => solr-configuration}/tasks/main.yml (100%) rename provisioning/roles/{geerlingguy.solr-cleanup => solr-configuration}/templates/core.properties.j2 (100%) rename provisioning/roles/{geerlingguy.solr-cleanup => solr-configuration}/templates/solr4.unit.j2 (100%) diff --git a/drupalbox/drupalbox.yml b/drupalbox/drupalbox.yml index 60d1c2d..80fd262 100644 --- a/drupalbox/drupalbox.yml +++ b/drupalbox/drupalbox.yml @@ -40,7 +40,7 @@ become: yes } - { - role: geerlingguy.solr-cleanup, + role: solr-configuration, become: yes } - { role: apache } diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml b/provisioning/roles/solr-configuration/tasks/cores.yml similarity index 100% rename from provisioning/roles/geerlingguy.solr-cleanup/tasks/cores.yml rename to provisioning/roles/solr-configuration/tasks/cores.yml diff --git a/provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml b/provisioning/roles/solr-configuration/tasks/main.yml similarity index 100% rename from provisioning/roles/geerlingguy.solr-cleanup/tasks/main.yml rename to provisioning/roles/solr-configuration/tasks/main.yml diff --git a/provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 b/provisioning/roles/solr-configuration/templates/core.properties.j2 similarity index 100% rename from provisioning/roles/geerlingguy.solr-cleanup/templates/core.properties.j2 rename to provisioning/roles/solr-configuration/templates/core.properties.j2 diff --git a/provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 b/provisioning/roles/solr-configuration/templates/solr4.unit.j2 similarity index 100% rename from provisioning/roles/geerlingguy.solr-cleanup/templates/solr4.unit.j2 rename to provisioning/roles/solr-configuration/templates/solr4.unit.j2