-----> Starting Kitchen (v1.10.2) -----> Creating ... Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'bento/ubuntu-14.04'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'bento/ubuntu-14.04' is up to date... ==> default: Setting the name of the VM: kitchen-cic_elkstack-default-ubuntu-1404_default_1470665751169_47542 ==> default: Fixed port collision for 80 => 8080. Now on port 2201. ==> default: Fixed port collision for 22 => 2222. Now on port 2202. ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 9200 (guest) => 9200 (host) (adapter 1) default: 80 (guest) => 2201 (host) (adapter 1) default: 443 (guest) => 8443 (host) (adapter 1) default: 22 (guest) => 2202 (host) (adapter 1) ==> default: Booting VM... ==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2202 default: SSH username: vagrant default: SSH auth method: private key default: Warning: Remote connection disconnect. Retrying... default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key... ==> default: Machine booted and ready! ==> default: Checking for guest additions in VM... ==> default: Setting hostname... ==> default: Machine not provisioned because `--no-provision` is specified. [SSH] Established Vagrant instance created. Finished creating (2m0.63s). -----> Kitchen is finished. (2m1.09s) jnganga@ubuntu:~/projects/APPCARTRIDGE/cic-elkstack/chef/cookbooks/cic_elkstack$ kitchen list Instance Driver Provisioner Verifier Transport Last Action default-ubuntu-1404 Vagrant ChefZero Busser Ssh Created default-ubuntu-1204 Vagrant ChefZero Busser Ssh default-centos-65 Vagrant ChefZero Busser Ssh default-centos-7 Vagrant ChefZero Busser Ssh jnganga@ubuntu:~/projects/APPCARTRIDGE/cic-elkstack/chef/cookbooks/cic_elkstack$ kitchen converge default-ubuntu-1404 -----> Starting Kitchen (v1.10.2) -----> Converging ... Preparing files for transfer Preparing dna.json Resolving cookbook dependencies with Berkshelf 4.3.5... Removing non-cookbook files before transfer Preparing validation.pem Preparing client.rb -----> Installing Chef Omnibus (install only if missing) Downloading https://omnitruck.chef.io/install.sh to file /tmp/install.sh Trying wget... Download complete. ubuntu 14.04 x86_64 Getting information for chef stable for ubuntu... downloading https://omnitruck.chef.io/stable/chef/metadata?v=&p=ubuntu&pv=14.04&m=x86_64 to file /tmp/install.sh.1462/metadata.txt trying wget... sha1 6a92025699634228efb118bc2ac2cc556992b140 sha256 d64a029bc5402e2c2e2e1ad479e8b49b3dc7599a9d50ea3cefe4149b070582be url https://packages.chef.io/stable/ubuntu/14.04/chef_12.12.15-1_amd64.deb version 12.12.15 downloaded metadata file looks valid... downloading https://packages.chef.io/stable/ubuntu/14.04/chef_12.12.15-1_amd64.deb to file /tmp/install.sh.1462/chef_12.12.15-1_amd64.deb trying wget... Comparing checksum with sha256sum... WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING You are installing an omnibus package without a version pin. If you are installing on production servers via an automated process this is DANGEROUS and you will be upgraded without warning on new releases, even to new major releases. Letting the version float is only appropriate in desktop, test, development or CI/CD environments. WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING Installing chef installing with dpkg... Selecting previously unselected package chef. (Reading database ... 32924 files and directories currently installed.) Preparing to unpack .../chef_12.12.15-1_amd64.deb ... Unpacking chef (12.12.15-1) ... Setting up chef (12.12.15-1) ... Thank you for installing Chef! Transferring files to Starting Chef Client, version 12.12.15 Creating a new client identity for default-ubuntu-1404 using the validator key. resolving cookbooks for run list: ["apt", "java::default", "cic_elkstack::packer"] Synchronizing Cookbooks: - apt (2.9.2) - cic_elkstack (0.1.0) - java (1.41.0) - windows (1.44.1) - homebrew (2.1.0) - elkstack (6.0.4) - chef_handler (1.4.0) - build-essential (2.4.0) - chef-sugar (3.4.0) - cron (1.7.6) - elasticsearch (0.3.14) - firewall (2.5.2) - htpasswd (0.2.4) - kibana_lwrp (3.0.2) - line (0.6.3) - logstash (0.12.0) - openssl (4.4.0) - newrelic_meetme_plugin (0.4.0) - nginx (2.7.6) - rackspace_monitoring (1.1.1) - python (1.4.6) - rsyslog (4.0.1) - runit (1.8.0) - 7-zip (1.0.2) - yum (3.11.0) - ark (1.2.0) - git (4.6.0) - libarchive (0.6.2) - apache2 (3.2.2) - logrotate (2.1.0) - ant (1.0.3) - curl (2.0.1) - bluepill (2.4.3) - ohai (2.1.0) - yum-epel (0.7.0) - compat_resource (12.10.7) - packagecloud (0.2.4) - dmg (2.4.0) - seven_zip (2.0.1) Installing Cookbook Gems: Compiling Cookbooks... [2016-08-08T14:19:26+00:00] WARN: Chef::Provider::AptRepository already exists! Cannot create deprecation class for LWRP provider apt_repository from cookbook apt [2016-08-08T14:19:26+00:00] WARN: AptRepository already exists! Deprecation class overwrites Custom resource apt_repository from cookbook apt Recipe: chef-sugar::default * chef_gem[chef-sugar] action install - install version 3.4.0 of package chef-sugar [2016-08-08T14:19:36+00:00] WARN: Could not find encrypted data bag item lumberjack/secrets [2016-08-08T14:19:36+00:00] WARN: Could not find un-encrypted data bag item lumberjack/secrets [2016-08-08T14:19:36+00:00] WARN: Could not find an encrypted or unencrypted data bag to use as a lumberjack keypair Converging 120 resources Recipe: apt::default * file[/var/lib/apt/periodic/update-success-stamp] action nothing (skipped due to action :nothing) * directory[/etc/apt/apt.conf.d] action create (up to date) * cookbook_file[/etc/apt/apt.conf.d/15update-stamp] action create - create new file /etc/apt/apt.conf.d/15update-stamp - update content in file /etc/apt/apt.conf.d/15update-stamp from none to 174cdb --- /etc/apt/apt.conf.d/15update-stamp 2016-08-08 14:19:37.394372407 +0000 +++ /etc/apt/apt.conf.d/.chef-15update-stamp20160808-1550-ioel76 2016-08-08 14:19:37.386376407 +0000 @@ -1 +1,2 @@ +APT::Update::Post-Invoke-Success {"touch /var/lib/apt/periodic/update-success-stamp 2>/dev/null || true";}; * execute[apt-get update] action nothing (skipped due to action :nothing) * execute[apt-get autoremove] action nothing (skipped due to action :nothing) * execute[apt-get autoclean] action nothing (skipped due to action :nothing) * execute[apt-get-update-periodic] action run - execute apt-get update * file[/var/lib/apt/periodic/update-success-stamp] action touch - update utime on file /var/lib/apt/periodic/update-success-stamp * directory[/var/cache/local] action create - create new directory /var/cache/local - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' * directory[/var/cache/local/preseeding] action create - create new directory /var/cache/local/preseeding - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' * template[/etc/apt/apt.conf.d/10recommends] action create - create new file /etc/apt/apt.conf.d/10recommends - update content in file /etc/apt/apt.conf.d/10recommends from none to f41e1d --- /etc/apt/apt.conf.d/10recommends 2016-08-08 14:20:00.718704407 +0000 +++ /etc/apt/apt.conf.d/.chef-10recommends20160808-1550-1i8vsnl 2016-08-08 14:20:00.718704407 +0000 @@ -1 +1,4 @@ +# Managed by Chef +APT::Install-Recommends "1"; +APT::Install-Suggests "0"; - change mode from '' to '0644' - change owner from '' to 'root' - change group from '' to 'root' * apt_package[apt-transport-https] action install (up to date) Recipe: java::notify * log[jdk-version-changed] action nothing (skipped due to action :nothing) Recipe: java::openjdk * apt_repository[openjdk-r-ppa] action add * execute[apt-cache gencaches] action nothing (skipped due to action :nothing) * apt_update[openjdk-r-ppa] action nothing (skipped due to action :nothing) * execute[install-key DA1A4A13543B466853BAF164EB9B1D8886F44E2A] action run - execute apt-key adv --recv --keyserver hkp://keyserver.ubuntu.com:80 DA1A4A13543B466853BAF164EB9B1D8886F44E2A * execute[apt-cache gencaches] action run - execute apt-cache gencaches * file[/etc/apt/sources.list.d/openjdk-r-ppa.list] action create - create new file /etc/apt/sources.list.d/openjdk-r-ppa.list - update content in file /etc/apt/sources.list.d/openjdk-r-ppa.list from none to 6c91a3 --- /etc/apt/sources.list.d/openjdk-r-ppa.list 2016-08-08 14:20:02.949588407 +0000 +++ /etc/apt/sources.list.d/.chef-openjdk-r-ppa.list20160808-1550-wjj6gu 2016-08-08 14:20:02.949588407 +0000 @@ -1 +1,2 @@ +deb "http://ppa.launchpad.net/openjdk-r/ppa/ubuntu" trusty main - change mode from '' to '0644' - change owner from '' to 'root' - change group from '' to 'root' * execute[apt-cache gencaches] action run - execute apt-cache gencaches * apt_update[openjdk-r-ppa] action update - force update new lists of packages * directory[/var/lib/apt/periodic] action create (up to date) * directory[/etc/apt/apt.conf.d] action create (up to date) * file[/etc/apt/apt.conf.d/15update-stamp] action create_if_missing (up to date) * execute[apt-get -q update] action run - execute apt-get -q update * apt_package[openjdk-7-jdk] action install - install version 7u101-2.6.6-0ubuntu0.14.04.1 of package openjdk-7-jdk Recipe: java::notify * log[jdk-version-changed] action write Recipe: java::openjdk * apt_package[openjdk-7-jre-headless] action install (up to date) * java_alternatives[set-java-alternatives] action set - Removing alternative for appletviewer with old prio - Add alternative for appletviewer - Add alternative for apt - Removing alternative for extcheck with old prio - Add alternative for extcheck - Removing alternative for idlj with old prio - Add alternative for idlj - Removing alternative for jar with old prio - Add alternative for jar - Removing alternative for jarsigner with old prio - Add alternative for jarsigner - Add alternative for java - Removing alternative for javac with old prio - Add alternative for javac - Removing alternative for javadoc with old prio - Add alternative for javadoc - Removing alternative for javah with old prio - Add alternative for javah - Removing alternative for javap with old prio - Add alternative for javap - Removing alternative for jcmd with old prio - Add alternative for jcmd - Removing alternative for jconsole with old prio - Add alternative for jconsole - Removing alternative for jdb with old prio - Add alternative for jdb - Removing alternative for jhat with old prio - Add alternative for jhat - Removing alternative for jinfo with old prio - Add alternative for jinfo - Removing alternative for jmap with old prio - Add alternative for jmap - Removing alternative for jps with old prio - Add alternative for jps - Removing alternative for jrunscript with old prio - Add alternative for jrunscript - Removing alternative for jsadebugd with old prio - Add alternative for jsadebugd - Removing alternative for jstack with old prio - Add alternative for jstack - Removing alternative for jstat with old prio - Add alternative for jstat - Removing alternative for jstatd with old prio - Add alternative for jstatd - Add alternative for keytool - Removing alternative for native2ascii with old prio - Add alternative for native2ascii - Add alternative for orbd - Add alternative for pack200 - Add alternative for policytool - Removing alternative for rmic with old prio - Add alternative for rmic - Add alternative for rmid - Add alternative for rmiregistry - Removing alternative for schemagen with old prio - Add alternative for schemagen - Removing alternative for serialver with old prio - Add alternative for serialver - Add alternative for servertool - Add alternative for tnameserv - Add alternative for unpack200 - Removing alternative for wsgen with old prio - Add alternative for wsgen - Removing alternative for wsimport with old prio - Add alternative for wsimport - Removing alternative for xjc with old prio - Add alternative for xjc Recipe: java::default_java_symlink * link[/usr/lib/jvm/default-java] action create - create symlink at /usr/lib/jvm/default-java to /usr/lib/jvm/java-7-openjdk-amd64 Recipe: java::set_java_home * ruby_block[set-env-java-home] action run - execute the ruby block set-env-java-home * directory[/etc/profile.d] action create (up to date) * template[/etc/profile.d/jdk.sh] action create - create new file /etc/profile.d/jdk.sh - update content in file /etc/profile.d/jdk.sh from none to 6db9b5 --- /etc/profile.d/jdk.sh 2016-08-08 14:22:49.000518407 +0000 +++ /etc/profile.d/.chef-jdk.sh20160808-1550-16oowvh 2016-08-08 14:22:49.000518407 +0000 @@ -1 +1,2 @@ +export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 - change mode from '' to '0755' Recipe: build-essential::_debian * apt_package[autoconf] action install - install version 2.69-6 of package autoconf * apt_package[binutils-doc] action install - install version 2.24-5ubuntu14.1 of package binutils-doc * apt_package[bison] action install - install version 2:3.0.2.dfsg-2 of package bison * apt_package[build-essential] action install - install version 11.6ubuntu6 of package build-essential * apt_package[flex] action install - install version 2.5.35-10.1ubuntu2 of package flex * apt_package[gettext] action install - install version 0.18.3.1-1ubuntu3 of package gettext * apt_package[ncurses-dev] action install - install version 5.9+20140118-1ubuntu1 of package ncurses-dev Recipe: chef-sugar::default * chef_gem[chef-sugar] action install (up to date) Recipe: python::package * apt_package[python] action install (up to date) * apt_package[python-dev] action install - install version 2.7.5-5ubuntu3 of package python-dev Recipe: python::pip * cookbook_file[/tmp/kitchen/cache/get-pip.py] action create - create new file /tmp/kitchen/cache/get-pip.py - update content in file /tmp/kitchen/cache/get-pip.py from none to 415b4d (long diff of over 1000000 characters, diff output suppressed) - change mode from '' to '0644' * execute[install-pip] action run - execute /usr/bin/python get-pip.py * python_pip[setuptools] action upgrade - upgrade python_pip[setuptools] version from to latest Recipe: elkstack::_python * bash[manually upgrade setuptools] action run (skipped due to only_if) Recipe: python::virtualenv * python_pip[virtualenv] action upgrade - upgrade python_pip[virtualenv] version from to latest Recipe: elkstack::_server * apt_package[ruby] action install - install version 1:1.9.3.4 of package ruby * append_if_no_line[make sure a line is in /etc/hosts] action edit Recipe: firewall::default * firewall[default] action install - install iptables and enable/start services * apt_package[iptables-persistent] action install - install version 0.5.7 of package iptables-persistent * file[create empty /etc/iptables/rules.v4] action create (skipped due to not_if) * file[create empty /etc/iptables/rules.v6] action create (skipped due to not_if) * service[iptables-persistent] action enable (up to date) * service[iptables-persistent] action start (up to date) * firewall_rule[allow world to ssh] action create * firewall_rule[allow world to winrm] action create (skipped due to only_if) * firewall_rule[allow world to mosh] action create (skipped due to only_if) * firewall_rule[established] action create * firewall_rule[ipv6_icmp] action create Recipe: elkstack::acl * firewall_rule[allow syslog entries inbound] action create * firewall_rule[allow lumberjack entries inbound] action create * firewall_rule[allow tcp entries inbound] action create * firewall_rule[allow nginx SSL entries inbound] action create * firewall_rule[allow nginx entries inbound] action create * firewall_rule[allow udp entries inbound] action create * firewall_rule[open_loopback] action create Recipe: elasticsearch::curl * apt_package[curl] action install - install version 7.35.0-1ubuntu2.7 of package curl Recipe: ark::default * apt_package[libtool] action install - install version 2.4.2-1.7ubuntu1 of package libtool * apt_package[autoconf] action install (up to date) * apt_package[make] action install (up to date) * apt_package[unzip] action install - install version 6.0-9ubuntu1.5 of package unzip * apt_package[rsync] action install (up to date) * apt_package[gcc] action install (up to date) * apt_package[autogen] action install - install version 1:5.18-2ubuntu2 of package autogen * apt_package[shtool] action install - install version 2.0.8-6 of package shtool * apt_package[pkg-config] action install - install version 0.26-1ubuntu4 of package pkg-config Recipe: elasticsearch::default * group[elasticsearch] action create - create group elasticsearch * user[elasticsearch] action create - create user elasticsearch * bash[remove the elasticsearch user home] action run (skipped due to only_if) * directory[/usr/local/etc/elasticsearch] action create - create new directory /usr/local/etc/elasticsearch - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * directory[/usr/local/var/log/elasticsearch] action create - create new directory /usr/local/var/log/elasticsearch - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * directory[/usr/local/var/run] action create - create new directory /usr/local/var/run - change mode from '' to '0755' * directory[/usr/local/var/data/elasticsearch] action create - create new directory /usr/local/var/data/elasticsearch - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * template[/etc/init.d/elasticsearch] action create - create new file /etc/init.d/elasticsearch - update content in file /etc/init.d/elasticsearch from none to 0b1df9 --- /etc/init.d/elasticsearch 2016-08-08 14:26:14.622054407 +0000 +++ /etc/init.d/.chef-elasticsearch20160808-1550-om49oi 2016-08-08 14:26:14.622054407 +0000 @@ -1 +1,201 @@ +#!/usr/bin/env bash +# +# elasticsearch +# +### BEGIN INIT INFO +# Provides: elasticsearch +# Required-Start: $network $remote_fs $named +# Required-Stop: $network $remote_fs $named +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Starts elasticsearch +# Description: Starts elasticsearch using start-stop-daemon +### END INIT INFO + +# Source networking configuration +# +if [ -f /etc/sysconfig/network ]; then source /etc/sysconfig/network; fi + +# Set limits for environments ignoring `/etc/security/limits.d` +# +ulimit -n 64000 +ulimit -l unlimited + +# Exit if networking is not up +# +[ "$NETWORKING" = "no" ] && exit + +PIDFILE='/usr/local/var/run/default_ubuntu_1404.pid' +ES_INCLUDE='/usr/local/etc/elasticsearch/elasticsearch-env.sh' +CHECK_PID_RUNNING=$(ps ax | grep 'java' | grep -e "es.pidfile=$PIDFILE" | sed 's/^\s*\([0-9]*\)\s.*/\1/') +RUBY_BIN="" + +if command -v ruby >/dev/null 2>&1; then + RUBY_BIN=$(command -v ruby) + # ruby < 1.9 needs this, afterwards it doesn't work _at all_ + if $RUBY_BIN -rubygems -e "puts Gem::VERSION" >/dev/null 2>&1; then + RUBY_BIN="$RUBY_BIN -rubygems " + fi +fi + +start() { + if [ -f $PIDFILE ]; then + # PIDFILE EXISTS -- ES RUNNING? + echo -e "PID file found in $PIDFILE" + es_pid="$(cat $PIDFILE)" + pid_running="$( ps ax | grep 'java' | grep $es_pid )" + + if [ ! -z "$pid_running" ] ; then + # EXIT IF ES IS ALREADY RUNNING + echo -e "\033[31;1mPID $es_pid still alive, Elasticsearch already running...\033[0m" + return 1 + fi + fi + + echo -en "\033[1mStarting Elasticsearch...\033[0m" + touch $PIDFILE && chown elasticsearch $PIDFILE + ES_INCLUDE=$ES_INCLUDE start-stop-daemon --background --start --quiet --pidfile $PIDFILE --chuid elasticsearch --exec /usr/local/bin/elasticsearch -- -p $PIDFILE + + if [ $? ]; then + echo -e " \e[32m[OK]\e[0m" + else + echo -e " \e[31m[FAILURE]\e[0m" + fi + + return $? +} + +stop() { + if [[ -f $PIDFILE ]]; then + echo -n -e "\033[1mStopping elasticsearch...\033[0m" + + # REMOVE PIDFILE AND EXIT IF PROCESS NOT RUNNING + if [ ! $CHECK_PID_RUNNING ]; then + echo -e "\033[1mPID file found, but no matching process running?\033[0m" + echo "Removing PID file..." + rm $PIDFILE + exit 0 + fi + + # KILL PROCESS + pid=$(cat $PIDFILE) + su elasticsearch -m -c "kill $(cat $PIDFILE)" + r=$? + + # Check for process + timeout=0 + while [ $(ps -p $pid | wc -l ) -gt '1' ]; do + echo -n '.' + (( timeout ++)) + if [ $timeout -gt '30' ]; then return; fi + sleep 1 + done + + # Check for pidfile + timeout=0 + while [ -f $PIDFILE ]; do + echo -n '.' + (( timeout++ )) + if [ $timeout -gt '15' ]; then return; fi + sleep 1 + done + + echo; + + return $r + else + echo -e "\033[1mNo PID file found -- elasticsearch not running?\033[0m" + fi +} + +restart() { + stop + timeout=30 + while ps aux | grep 'java' | grep -e "es.pidfile"; do + echo -n '.' + (( timeout-- )) + if [ $timeout -lt '1' ]; then return; fi + sleep 1 + done; + start +} + +status() { + # GOT PIDFILE? + [ -f $PIDFILE ] && pid=$(cat $PIDFILE) + + # RUNNING + if [[ $pid && -d "/proc/$pid" ]]; then + if [ -z "$RUBY_BIN" ]; then + version=$(curl -s 'http://localhost:9200' | $RUBY_BIN -e 'require "json"; print JSON.parse(STDIN.read)["version"]["number"]') + echo -e "\033[1;37;46melasticsearch $version running with PID $pid\033[0m" + else + echo -e "\033[1;37;46melasticsearch running with PID $pid\033[0m" + fi + # VERBOSE + if [[ $pid && $1 == '-v' || $1 == '--verbose' ]]; then + if [ -z "$RUBY_BIN" ]; then + curl -s 'http://localhost:9200/_cluster/nodes/default-ubuntu-1404?os&process&jvm&network&transport&settings&pretty' | \ + $RUBY_BIN -e ' + begin + require "json"; h = JSON.parse(STDIN.read); id, node = h["nodes"].first; + def e(name, value); puts %Q|\e[1;36m#{(name.to_s+":").ljust(20)}\e[0m #{value || "N/A" rescue "N/A"}|; end + e "HTTP Address", node["http_address"] + e "Node Name", node["name"] + e "Cluster Name", h["cluster_name"] + e "Started", Time.at(node["jvm"]["start_time"].to_i/1000) + e "JVM", "#{node["jvm"]["vm_name"]} (#{node["jvm"]["version"]})" + e "Memory Total", node["os"]["mem"]["total"] + e "Open Files", node["process"]["max_file_descriptors"] + e "Configuration", node["settings"]["config"] + rescue + puts "Metadata cannot be retrieved." + end + ' + else + echo >&2 "verbose requires ruby but it is not installed" + exit 1 + fi + fi + # INCORRECT PID? + if [ $pid != $CHECK_PID_RUNNING ]; then + echo -e "\033[1;31;40m[!] Incorrect PID found in $PIDFILE: $pid\033[0m" + return 1 + fi + return 0 + fi + + # NOT RUNNING + if [[ ! $pid || ! -d "/proc/$pid" ]]; then + echo -e "\033[1;33;40melasticsearch not running\033[0m" + return 3 + fi + + # STALE PID FOUND + if [[ ! -d "/proc/$pid" && -f $PIDFILE ]]; then + echo -e "\033[1;31;40m[!] Stale PID found in $PIDFILE\033[0m" + return 1 + fi +} + + +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + restart + ;; + status) + status $2 + ;; + *) + echo $"Usage: $0 {start|stop|restart|status [-v]|}" + exit 1 +esac + +exit $? - change mode from '' to '0755' - change owner from '' to 'root' * service[elasticsearch] action enable - enable service service[elasticsearch] * ark[elasticsearch] action install * directory[/usr/local/elasticsearch-1.4.4] action create - create new directory /usr/local/elasticsearch-1.4.4 * remote_file[/tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz] action create - create new file /tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz - update content in file /tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz from none to a3158d (file sizes exceed 10000000 bytes, diff output suppressed) * execute[unpack /tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz] action nothing (skipped due to action :nothing) * execute[set owner on /usr/local/elasticsearch-1.4.4] action nothing (skipped due to action :nothing) * link[/usr/local/bin/elasticsearch] action create - create symlink at /usr/local/bin/elasticsearch to /usr/local/elasticsearch-1.4.4/bin/elasticsearch * link[/usr/local/bin/plugin] action create - create symlink at /usr/local/bin/plugin to /usr/local/elasticsearch-1.4.4/bin/plugin * link[/usr/local/elasticsearch] action create - create symlink at /usr/local/elasticsearch to /usr/local/elasticsearch-1.4.4 * template[/etc/profile.d/elasticsearch.sh] action create (skipped due to only_if) * ruby_block[adding '/usr/local/elasticsearch-1.4.4/bin' to chef-client ENV['PATH']] action run (skipped due to only_if) * execute[unpack /tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz] action run - execute /bin/tar xzf /tmp/kitchen/cache/elasticsearch-1.4.4.tar.gz --strip-components=1 * execute[set owner on /usr/local/elasticsearch-1.4.4] action run - execute chown -R elasticsearch:elasticsearch /usr/local/elasticsearch-1.4.4 * bash[enable user limits] action run - execute "bash" "/tmp/chef-script20160808-1550-y5h4rz" * file[/etc/security/limits.d/10-elasticsearch.conf] action create - create new file /etc/security/limits.d/10-elasticsearch.conf - update content in file /etc/security/limits.d/10-elasticsearch.conf from none to 0a6b42 --- /etc/security/limits.d/10-elasticsearch.conf 2016-08-08 14:26:19.490054407 +0000 +++ /etc/security/limits.d/.chef-10-elasticsearch.conf20160808-1550-1l0xprr 2016-08-08 14:26:19.490054407 +0000 @@ -1 +1,3 @@ +elasticsearch - nofile 64000 +elasticsearch - memlock unlimited * log[increase limits] action write * log[increase limits] action nothing (skipped due to action :nothing) * template[elasticsearch-env.sh] action create - create new file /usr/local/etc/elasticsearch/elasticsearch-env.sh - update content in file /usr/local/etc/elasticsearch/elasticsearch-env.sh from none to 7adadc --- /usr/local/etc/elasticsearch/elasticsearch-env.sh 2016-08-08 14:26:19.546054407 +0000 +++ /usr/local/etc/elasticsearch/.chef-elasticsearch-env.sh20160808-1550-1subloa 2016-08-08 14:26:19.546054407 +0000 @@ -1 +1,25 @@ +# JVM Configuration for ElasticSearch +# =================================== +# See +# + +ES_HOME='/usr/local/elasticsearch' +ES_CLASSPATH=$ES_CLASSPATH:$ES_HOME/lib/*:$ES_HOME/lib/sigar/* +ES_HEAP_SIZE=195m + +ES_JAVA_OPTS=" + -server + -Djava.net.preferIPv4Stack=true + -Des.config=/usr/local/etc/elasticsearch/elasticsearch.yml + -Xms195m + -Xmx195m + -Xss256k + -XX:+UseParNewGC + -XX:+UseConcMarkSweepGC + -XX:CMSInitiatingOccupancyFraction=75 + -XX:+UseCMSInitiatingOccupancyOnly + -XX:+HeapDumpOnOutOfMemoryError + + +" - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * template[elasticsearch.yml] action create - create new file /usr/local/etc/elasticsearch/elasticsearch.yml - update content in file /usr/local/etc/elasticsearch/elasticsearch.yml from none to b00553 --- /usr/local/etc/elasticsearch/elasticsearch.yml 2016-08-08 14:26:19.646054407 +0000 +++ /usr/local/etc/elasticsearch/.chef-elasticsearch.yml20160808-1550-1w93ax5 2016-08-08 14:26:19.646054407 +0000 @@ -1 +1,90 @@ +######################### ElasticSearch Configuration ######################## + +# This file is managed by Chef, do not edit manually, your changes *will* be overwritten! +# +# Please see the source file for context and more information: +# +# https://github.com/elasticsearch/elasticsearch/blob/master/config/elasticsearch.yml +# +# To set configurations not exposed by this template, set the +# `node.elasticsearch[:custom_config]` attribute in your node configuration, +# `elasticsearch/settings` data bag, role/environment definition, etc: +# +# // ... +# 'threadpool.index.type' => 'fixed', +# 'threadpool.index.size' => '2' +# // ... + +################################### Cluster ################################### + +cluster.name: elasticsearch + +#################################### Node ##################################### + +node.name: default-ubuntu-1404 +node.max_local_storage_nodes: 1 + +#################################### Index #################################### + +index.number_of_replicas: 0 +index.mapper.dynamic: true +action.auto_create_index: true +action.disable_delete_all_indices: true + +#################################### Paths #################################### + +path.conf: /usr/local/etc/elasticsearch +path.data: /usr/local/var/data/elasticsearch +path.logs: /usr/local/var/log/elasticsearch + +#################################### Plugin ################################### + + +################################### Memory #################################### + +bootstrap.mlockall: false + +############################## Network And HTTP ############################### + +network.host: 127.0.0.1 +http.port: 9200 + +################################### Gateway ################################### + +gateway.expected_nodes: 1 + +############################# Recovery Throttling ############################# + + +################################## Discovery ################################## + + +discovery.zen.minimum_master_nodes: 1 +discovery.zen.ping.multicast.enabled: false +discovery.zen.ping.unicast.hosts: + +cloud.node.auto_attributes: true + + +################################## Slow Log ################################### + + +################################## GC Logging ################################# + + +################################## JMX ######################################## + + +################################## Custom ##################################### + +rackspace.account: +rackspace.enabled: +rackspace.key: +rackspace.region: ORD +repositories.cloudfiles.base_path: / +repositories.cloudfiles.chunk_size: 100m +repositories.cloudfiles.compress: false +repositories.cloudfiles.concurrent_streams: 5 +repositories.cloudfiles.container: elkstack +script.disable_dynamic: false - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * template[logging.yml] action create - create new file /usr/local/etc/elasticsearch/logging.yml - update content in file /usr/local/etc/elasticsearch/logging.yml from none to c798a9 --- /usr/local/etc/elasticsearch/logging.yml 2016-08-08 14:26:19.686054407 +0000 +++ /usr/local/etc/elasticsearch/.chef-logging.yml20160808-1550-1s4hz84 2016-08-08 14:26:19.686054407 +0000 @@ -1 +1,72 @@ +# This file is managed by Chef, do not edit manually, your changes *will* be overwritten! +# +# Please see the source file for context and more information: +# +# https://github.com/elasticsearch/elasticsearch/blob/master/config/logging.yml +# +# Any settings configured under the `node.elasticsearch.logging` +# node attribute will be automatically used. +# +# So, for example when you set these attributes in your node configuration, +# `elasticsearch/settings` data bag, role/environment definition, etc: +# +# // ... +# :logging => { +# :discovery => 'TRACE', +# 'index.indexing.slowlog' => 'INFO, index_indexing_slow_log_file' +# } +# // ... +# +# the relevant configuration will be printed into the `logging.yml` file: +# +# // ... +# logger.discovery: TRACE +# logger.index.indexing.slowlog: INFO, index_indexing_slow_log_file +# // ... +# + +es.logger.level: INFO +rootLogger: INFO, console, file + +# ----- Configuration set by Chef --------------------------------------------- +logger.action: DEBUG +logger.com.amazonaws: WARN +logger.index.indexing.slowlog: TRACE, index_indexing_slow_log_file +logger.index.search.slowlog: TRACE, index_search_slow_log_file +# ----------------------------------------------------------------------------- + +additivity: + index.search.slowlog: false + index.indexing.slowlog: false + +appender: + console: + type: console + layout: + type: consolePattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + index_search_slow_log_file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}_index_search_slowlog.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" + + index_indexing_slow_log_file: + type: dailyRollingFile + file: ${path.logs}/${cluster.name}_index_indexing_slowlog.log + datePattern: "'.'yyyy-MM-dd" + layout: + type: pattern + conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' Recipe: elasticsearch::plugins * directory[/usr/local/elasticsearch-1.4.4/plugins/] action create - create new directory /usr/local/elasticsearch-1.4.4/plugins/ - change mode from '' to '0755' - change owner from '' to 'elasticsearch' - change group from '' to 'elasticsearch' * ruby_block[Install plugin: karmi/elasticsearch-paramedic] action run-> Installing karmi/elasticsearch-paramedic... Trying https://github.com/karmi/elasticsearch-paramedic/archive/master.zip... Downloading .........................................................................................................................................................................................................................................................................................................................DONE Installed karmi/elasticsearch-paramedic into /usr/local/elasticsearch-1.4.4/plugins/paramedic - execute the ruby block Install plugin: karmi/elasticsearch-paramedic * ruby_block[Install plugin: mobz/elasticsearch-head] action run-> Installing mobz/elasticsearch-head... Trying https://github.com/mobz/elasticsearch-head/archive/master.zip... Downloading ............................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE Installed mobz/elasticsearch-head into /usr/local/elasticsearch-1.4.4/plugins/head - execute the ruby block Install plugin: mobz/elasticsearch-head * ruby_block[Install plugin: jlinn/elasticsearch-cloud-rackspace] action run-> Installing jlinn/elasticsearch-cloud-rackspace... Trying https://github.com/jlinn/elasticsearch-cloud-rackspace/releases/download/v0.4.1/elasticsearch-cloud-rackspace-0.4.1.zip... Downloading ........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................DONE Installed jlinn/elasticsearch-cloud-rackspace into /usr/local/elasticsearch-1.4.4/plugins/cloud-rackspace - execute the ruby block Install plugin: jlinn/elasticsearch-cloud-rackspace Recipe: elkstack::elasticsearch * service[elasticsearch] action start - start service service[elasticsearch] Recipe: elkstack::elasticsearch_monitoring * rackspace_monitoring_service[default] action create (skipped due to only_if) * rackspace_monitoring_service[default] action start (skipped due to only_if) * rackspace_monitoring_check[elasticsearch] action create (skipped due to only_if) * rackspace_monitoring_check[elasticsearch_service] action create (skipped due to only_if) Recipe: elkstack::logstash * logstash_instance[server] action create (up to date) * user[logstash] action create - create user logstash * group[logstash] action create - alter group logstash - add missing member(s): logstash * ark[server] action put * directory[/opt/logstash/server] action create - create new directory /opt/logstash/server * remote_file[/tmp/kitchen/cache/server.tar.gz] action create - create new file /tmp/kitchen/cache/server.tar.gz - update content in file /tmp/kitchen/cache/server.tar.gz from none to d5be17 (file sizes exceed 10000000 bytes, diff output suppressed) * execute[unpack /tmp/kitchen/cache/server.tar.gz] action nothing (skipped due to action :nothing) * execute[set owner on /opt/logstash/server] action nothing (skipped due to action :nothing) * execute[unpack /tmp/kitchen/cache/server.tar.gz] action run - execute /bin/tar xzf /tmp/kitchen/cache/server.tar.gz --strip-components=1 * execute[set owner on /opt/logstash/server] action run - execute chown -R logstash:logstash /opt/logstash/server * directory[/opt/logstash/server/bin] action create - change mode from '0775' to '0755' * directory[/opt/logstash/server/etc] action create - create new directory /opt/logstash/server/etc - change mode from '' to '0755' - change owner from '' to 'logstash' - change group from '' to 'logstash' * directory[/opt/logstash/server/lib] action create - change mode from '0775' to '0755' * directory[/opt/logstash/server/log] action create - create new directory /opt/logstash/server/log - change mode from '' to '0755' - change owner from '' to 'logstash' - change group from '' to 'logstash' * directory[/opt/logstash/server/tmp] action create - create new directory /opt/logstash/server/tmp - change mode from '' to '0755' - change owner from '' to 'logstash' - change group from '' to 'logstash' * directory[/opt/logstash/server/etc/conf.d] action create - create new directory /opt/logstash/server/etc/conf.d - change mode from '' to '0755' - change owner from '' to 'logstash' - change group from '' to 'logstash' * directory[/opt/logstash/server/patterns] action create - change mode from '0775' to '0755' Recipe: logrotate::default * apt_package[logrotate] action upgrade (up to date) * directory[/etc/logrotate.d] action create (up to date) * logrotate_app[logstash_server] action enable * directory[/etc/logrotate.d] action create (up to date) * template[/etc/logrotate.d/logstash_server] action create - create new file /etc/logrotate.d/logstash_server - update content in file /etc/logrotate.d/logstash_server from none to bb703b --- /etc/logrotate.d/logstash_server 2016-08-08 14:28:02.674054407 +0000 +++ /etc/logrotate.d/.chef-logstash_server20160808-1550-u5hwj2 2016-08-08 14:28:02.638054407 +0000 @@ -1 +1,16 @@ +# This file was generated by Chef for default-ubuntu-1404. +# Do not modify this file by hand! + +"/opt/logstash/server/log/*.log" { + daily + create 664 logstash logstash + rotate 10 + missingok + notifempty + compress + copytruncate + postrotate + service logstash_server restart + endscript +} - change mode from '' to '0644' - change owner from '' to 'root' - change group from '' to 'root' Recipe: runit::default * service[runit] action nothing (skipped due to action :nothing) * execute[start-runsvdir] action nothing (skipped due to action :nothing) * apt_package[runit] action install Recipe: * cookbook_file[/tmp/kitchen/cache/preseed/runit/runit-2.1.1-6.2ubuntu3.seed] action create - create new file /tmp/kitchen/cache/preseed/runit/runit-2.1.1-6.2ubuntu3.seed - update content in file /tmp/kitchen/cache/preseed/runit/runit-2.1.1-6.2ubuntu3.seed from none to 9c6758 --- /tmp/kitchen/cache/preseed/runit/runit-2.1.1-6.2ubuntu3.seed 2016-08-08 14:28:03.614054407 +0000 +++ /tmp/kitchen/cache/preseed/runit/.chef-runit-2.1.1-6.2ubuntu3.seed20160808-1550-1127x4r 2016-08-08 14:28:03.598054407 +0000 @@ -1 +1,2 @@ +runit runit/signalinit boolean true - preseed package runit - install version 2.1.1-6.2ubuntu3 of package runit Recipe: elkstack::logstash * logstash_service[server] action enable (up to date) Recipe: * service[logstash_server] action nothing (skipped due to action :nothing) * runit_service[logstash_server] action enable * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/logstash_server] action create - create new directory /etc/sv/logstash_server - change mode from '' to '0755' * template[/etc/sv/logstash_server/run] action create - create new file /etc/sv/logstash_server/run - update content in file /etc/sv/logstash_server/run from none to 5f7a12 --- /etc/sv/logstash_server/run 2016-08-08 14:30:26.654054407 +0000 +++ /etc/sv/logstash_server/.chef-run20160808-1550-1u8k3pg 2016-08-08 14:30:26.654054407 +0000 @@ -1 +1,18 @@ +#!/bin/sh + +ulimit -Hn 65550 +ulimit -Sn 65550 + +cd //opt/logstash/server +exec 2>&1 +# Need to set LOGSTASH_HOME and HOME so sincedb will work +export LS_HEAP_SIZE=97M +export LOGSTASH_HOME="/opt/logstash/server" +export GC_OPTS="" +export JAVA_OPTS="-server -Xms97M -Xmx97M -Djava.io.tmpdir=$LOGSTASH_HOME/tmp/ " +LOGSTASH_OPTS="agent -f $LOGSTASH_HOME/etc/conf.d" +LOGSTASH_OPTS="$LOGSTASH_OPTS --pluginpath $LOGSTASH_HOME/lib" +LOGSTASH_OPTS="$LOGSTASH_OPTS -l $LOGSTASH_HOME/log/logstash.log" +export LOGSTASH_OPTS="$LOGSTASH_OPTS -w 1" +HOME=$LOGSTASH_HOME exec chpst -u logstash:logstash $LOGSTASH_HOME/bin/logstash $LOGSTASH_OPTS - change mode from '' to '0755' * directory[/etc/sv/logstash_server/log] action create - create new directory /etc/sv/logstash_server/log * directory[/etc/sv/logstash_server/log/main] action create - create new directory /etc/sv/logstash_server/log/main - change mode from '' to '0755' * directory[/var/log/logstash_server] action create - create new directory /var/log/logstash_server - change mode from '' to '0755' * template[/etc/sv/logstash_server/log/config] action create - create new file /etc/sv/logstash_server/log/config - update content in file /etc/sv/logstash_server/log/config from none to e3b0c4 (no diff) - change mode from '' to '0644' * link[/var/log/logstash_server/config] action create - create symlink at /var/log/logstash_server/config to /etc/sv/logstash_server/log/config * template[/etc/sv/logstash_server/log/run] action create - create new file /etc/sv/logstash_server/log/run - update content in file /etc/sv/logstash_server/log/run from none to e64148 --- /etc/sv/logstash_server/log/run 2016-08-08 14:30:26.850054407 +0000 +++ /etc/sv/logstash_server/log/.chef-run20160808-1550-1eziwz2 2016-08-08 14:30:26.846054407 +0000 @@ -1 +1,3 @@ +#!/bin/sh +exec svlogd -tt ./main - change mode from '' to '0755' * directory[/etc/sv/logstash_server/env] action create - create new directory /etc/sv/logstash_server/env - change mode from '' to '0755' * ruby_block[zap extra env files for logstash_server service] action run (skipped due to only_if) * template[/etc/sv/logstash_server/check] action create (skipped due to only_if) * template[/etc/sv/logstash_server/finish] action create (skipped due to only_if) * directory[/etc/sv/logstash_server/control] action create - create new directory /etc/sv/logstash_server/control - change mode from '' to '0755' * link[/etc/init.d/logstash_server] action create - create symlink at /etc/init.d/logstash_server to /usr/bin/sv * file[/etc/sv/logstash_server/down] action nothing (skipped due to action :nothing) * ruby_block[restart_service] action run * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/logstash_server] action create (up to date) * template[/etc/sv/logstash_server/run] action create (up to date) * directory[/etc/sv/logstash_server/log] action create (up to date) * directory[/etc/sv/logstash_server/log/main] action create (up to date) * directory[/var/log/logstash_server] action create (up to date) * template[/etc/sv/logstash_server/log/config] action create (up to date) * link[/var/log/logstash_server/config] action create (up to date) * template[/etc/sv/logstash_server/log/run] action create (up to date) * directory[/etc/sv/logstash_server/env] action create (up to date) * ruby_block[zap extra env files for logstash_server service] action run (skipped due to only_if) * template[/etc/sv/logstash_server/check] action create (skipped due to only_if) * template[/etc/sv/logstash_server/finish] action create (skipped due to only_if) * directory[/etc/sv/logstash_server/control] action create (up to date) * link[/etc/init.d/logstash_server] action create (up to date) * file[/etc/sv/logstash_server/down] action nothing (skipped due to action :nothing) * directory[/etc/service] action create (up to date) * link[/etc/service/logstash_server] action create - create symlink at /etc/service/logstash_server to /etc/sv/logstash_server * ruby_block[wait for logstash_server service socket] action run - execute the ruby block wait for logstash_server service socket - execute the ruby block restart_service * ruby_block[restart_log_service] action run * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/logstash_server] action create (up to date) * template[/etc/sv/logstash_server/run] action create (up to date) * directory[/etc/sv/logstash_server/log] action create (up to date) * directory[/etc/sv/logstash_server/log/main] action create (up to date) * directory[/var/log/logstash_server] action create (up to date) * template[/etc/sv/logstash_server/log/config] action create (up to date) * link[/var/log/logstash_server/config] action create (up to date) * template[/etc/sv/logstash_server/log/run] action create (up to date) * directory[/etc/sv/logstash_server/env] action create (up to date) * ruby_block[zap extra env files for logstash_server service] action run (skipped due to only_if) * template[/etc/sv/logstash_server/check] action create (skipped due to only_if) * template[/etc/sv/logstash_server/finish] action create (skipped due to only_if) * directory[/etc/sv/logstash_server/control] action create (up to date) * link[/etc/init.d/logstash_server] action create (up to date) * file[/etc/sv/logstash_server/down] action nothing (skipped due to action :nothing) * directory[/etc/service] action create (up to date) * link[/etc/service/logstash_server] action create (up to date) * ruby_block[wait for logstash_server service socket] action run - execute the ruby block wait for logstash_server service socket - execute the ruby block restart_log_service * directory[/etc/service] action create (up to date) * link[/etc/service/logstash_server] action create (up to date) * ruby_block[wait for logstash_server service socket] action run - execute the ruby block wait for logstash_server service socket Recipe: elkstack::logstash * directory[/opt/logstash] action create - change owner from 'root' to 'logstash' - change group from 'root' to 'logstash' Recipe: elkstack::_lumberjack_secrets * file[/opt/logstash/lumberjack.key] action create (skipped due to not_if) * file[/opt/logstash/lumberjack.crt] action create (skipped due to not_if) Recipe: elkstack::logstash * logstash_config[server] action create * template[/opt/logstash/server/etc/conf.d/input_syslog] action create - create new file /opt/logstash/server/etc/conf.d/input_syslog - update content in file /opt/logstash/server/etc/conf.d/input_syslog from none to b44709 --- /opt/logstash/server/etc/conf.d/input_syslog 2016-08-08 14:30:33.202054407 +0000 +++ /opt/logstash/server/etc/conf.d/.chef-input_syslog20160808-1550-1ulnee1 2016-08-08 14:30:33.202054407 +0000 @@ -1 +1,36 @@ +input { + tcp { + port => "5959" + host => "0.0.0.0" + type => "syslog" + } +} + +filter { + if [type] == "syslog" { + grok { + overwrite => "message" + match => [ + "message", + "%{SYSLOGTIMESTAMP:timestamp} %{IPORHOST:host} (?:%{PROG:program}(?:\[%{POSINT:pid}\])?: )?%{GREEDYDATA:message}" + ] + } + syslog_pri { } + date { + # season to taste for your own syslog format(s) + match => [ + "timestamp", + "MMM d HH:mm:ss", + "MMM dd HH:mm:ss", + "ISO8601" + ] + } + } +} + +filter { + mutate { + replace => [ "input_chef_environment", "_default" ] + } +} - change mode from '' to '0644' - change owner from '' to 'logstash' - change group from '' to 'logstash' * template[/opt/logstash/server/etc/conf.d/input_tcp] action create - create new file /opt/logstash/server/etc/conf.d/input_tcp - update content in file /opt/logstash/server/etc/conf.d/input_tcp from none to e7f8bf --- /opt/logstash/server/etc/conf.d/input_tcp 2016-08-08 14:30:33.258054407 +0000 +++ /opt/logstash/server/etc/conf.d/.chef-input_tcp20160808-1550-16sc14d 2016-08-08 14:30:33.258054407 +0000 @@ -1 +1,13 @@ +input { + tcp { + port => "5961" + host => "0.0.0.0" + } +} + +filter { + mutate { + replace => [ "input_chef_environment", "_default" ] + } +} - change mode from '' to '0644' - change owner from '' to 'logstash' - change group from '' to 'logstash' * template[/opt/logstash/server/etc/conf.d/input_udp] action create - create new file /opt/logstash/server/etc/conf.d/input_udp - update content in file /opt/logstash/server/etc/conf.d/input_udp from none to 9fe62d --- /opt/logstash/server/etc/conf.d/input_udp 2016-08-08 14:30:33.310054407 +0000 +++ /opt/logstash/server/etc/conf.d/.chef-input_udp20160808-1550-1eicnsy 2016-08-08 14:30:33.310054407 +0000 @@ -1 +1,13 @@ +input { + udp { + port => "5962" + host => "0.0.0.0" + } +} + +filter { + mutate { + replace => [ "input_chef_environment", "_default" ] + } +} - change mode from '' to '0644' - change owner from '' to 'logstash' - change group from '' to 'logstash' * template[/opt/logstash/server/etc/conf.d/output_elasticsearch] action create - create new file /opt/logstash/server/etc/conf.d/output_elasticsearch - update content in file /opt/logstash/server/etc/conf.d/output_elasticsearch from none to 1f3ab4 --- /opt/logstash/server/etc/conf.d/output_elasticsearch 2016-08-08 14:30:33.386054407 +0000 +++ /opt/logstash/server/etc/conf.d/.chef-output_elasticsearch20160808-1550-xjvd7p 2016-08-08 14:30:33.386054407 +0000 @@ -1 +1,8 @@ +# no filters or mutators should be placed here, we preserve as much as possible by this stage +output { + elasticsearch { + host => "eslocal" + protocol => "transport" + } +} - change mode from '' to '0644' - change owner from '' to 'logstash' - change group from '' to 'logstash' Recipe: elkstack::logstash_monitoring * rackspace_monitoring_service[default] action create (skipped due to only_if) * rackspace_monitoring_service[default] action start (skipped due to only_if) * rackspace_monitoring_check[tcp-logstash-5959] action enable (skipped due to only_if) * rackspace_monitoring_check[logstash_service] action create (skipped due to only_if) Recipe: elkstack::kibana_ssl * directory[/etc/nginx/ssl] action create - create new directory /etc/nginx/ssl - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' * htpasswd[/etc/nginx/htpassword] action overwrite Recipe: htpasswd::_common * chef_gem[htauth] action install - install version ~> 1.1.0 of package htauth - Create htpasswd[/etc/nginx/htpassword] * ruby_block[Creating htpasswd file /etc/nginx/htpassword] action run - execute the ruby block Creating htpasswd file /etc/nginx/htpassword * chef_gem[htauth] action install (up to date) Recipe: elkstack::kibana_ssl * file[/etc/nginx/htpassword.curl] action create_if_missing - create new file /etc/nginx/htpassword.curl - update content in file /etc/nginx/htpassword.curl from none to bdc090 --- /etc/nginx/htpassword.curl 2016-08-08 14:30:49.026054407 +0000 +++ /etc/nginx/.chef-htpassword.curl20160808-1550-2rgfes 2016-08-08 14:30:49.026054407 +0000 @@ -1 +1,2 @@ +user = "kibana:kibana" - change mode from '' to '0600' - change owner from '' to 'root' - change group from '' to 'root' * openssl_x509[/etc/nginx/ssl/kibana.pem] action create - Create openssl_x509[/etc/nginx/ssl/kibana.pem] * file[/etc/nginx/ssl/kibana.pem] action create_if_missing - create new file /etc/nginx/ssl/kibana.pem - update content in file /etc/nginx/ssl/kibana.pem from none to 7d9200 - suppressed sensitive resource * file[/etc/nginx/ssl/kibana.key] action create_if_missing - create new file /etc/nginx/ssl/kibana.key - update content in file /etc/nginx/ssl/kibana.key from none to b495ea - suppressed sensitive resource Recipe: elkstack::kibana * kibana_user[kibana] action create - create resource kibana * user[kibana] action create - create user kibana * group[kibana] action create - alter group kibana - add missing member(s): kibana * kibana_install[kibana] action create Recipe: libarchive::default * apt_package[libarchive-dev] action upgrade - upgrade package libarchive-dev from uninstalled to 3.1.2-7ubuntu2.3 * chef_gem[ffi-libarchive] action install - install version ~> 0.2.0 of package ffi-libarchive - create resource kibana * directory[/opt/kibana] action create (up to date) * apt_package[libarchive-dev] action nothing (skipped due to action :nothing) * chef_gem[ffi-libarchive] action install (up to date) * remote_file[/tmp/kitchen/cache/kibana_kibana_4.2.1-linux-x64_kibana.tar.gz] action create - create new file /tmp/kitchen/cache/kibana_kibana_4.2.1-linux-x64_kibana.tar.gz - update content in file /tmp/kitchen/cache/kibana_kibana_4.2.1-linux-x64_kibana.tar.gz from none to fc0aa9 (file sizes exceed 10000000 bytes, diff output suppressed) * libarchive_file[kibana_kibana_4.2.1-linux-x64_kibana.tar.gz] action extract * link[/opt/kibana/current] action create - create symlink at /opt/kibana/current to /opt/kibana/kibana-4.2.1-linux-x64 Recipe: elkstack::kibana * template[/opt/kibana/current/config/kibana.yml] action create - update content in file /opt/kibana/current/config/kibana.yml from e67619 to 648215 --- /opt/kibana/current/config/kibana.yml 2016-08-08 14:36:53.174054407 +0000 +++ /opt/kibana/current/config/.chef-kibana.yml20160808-1550-9cp50t 2016-08-08 14:37:05.734054407 +0000 @@ -1,77 +1,32 @@ -# Kibana is served by a back end server. This controls which port to use. -# server.port: 5601 +# Kibana is served by a backend server. This controls which port to use. +port: 5601 -# The host to bind the server to. -# server.host: "0.0.0.0" +# The Elasticsearch instance to user for all your queries +elasticsearch_url: "http://127.0.0.1:9200" -# A value to use as a XSRF token. This token is sent back to the server on each request -# and required if you want to execute requests from other clients (like curl). -# server.xsrf.token: "" +# Kibana uses and index in Elasticsearch to store saved searches, visualizations +# and dashboard. It will create an new index if it doesn't already exist. +kibana_index: "kibana-int" -# The Elasticsearch instance to use for all your queries. -# elasticsearch.url: "http://localhost:9200" -# preserve_elasticsearch_host true will send the hostname specified in `elasticsearch`. If you set it to false, -# then the host you use to connect to *this* Kibana instance will be sent. -# elasticsearch.preserveHost: true - -# Kibana uses an index in Elasticsearch to store saved searches, visualizations -# and dashboards. It will create a new index if it doesn't already exist. -# kibana.index: ".kibana" - -# The default application to load. -# kibana.defaultAppId: "discover" - -# If your Elasticsearch is protected with basic auth, this is the user credentials -# used by the Kibana server to perform maintenance on the kibana_index at startup. Your Kibana -# users will still need to authenticate with Elasticsearch (which is proxied through -# the Kibana server) -# elasticsearch.username: "user" -# elasticsearch.password: "pass" - -# SSL for outgoing requests from the Kibana Server to the browser (PEM formatted) -# server.ssl.cert: /path/to/your/server.crt -# server.ssl.key: /path/to/your/server.key - -# Optional setting to validate that your Elasticsearch backend uses the same key files (PEM formatted) -# elasticsearch.ssl.cert: /path/to/your/client.crt -# elasticsearch.ssl.key: /path/to/your/client.key - -# If you need to provide a CA certificate for your Elasticsearch instance, put -# the path of the pem file here. -# elasticsearch.ssl.ca: /path/to/your/CA.pem - -# Set to false to have a complete disregard for the validity of the SSL -# certificate. -# elasticsearch.ssl.verify: true - -# Time in milliseconds to wait for elasticsearch to respond to pings, defaults to -# request_timeout setting -# elasticsearch.pingTimeout: 1500 - # Time in milliseconds to wait for responses from the back end or elasticsearch. # This must be > 0 -# elasticsearch.requestTimeout: 300000 +request_timeout: 60000 # Time in milliseconds for Elasticsearch to wait for responses from shards. -# Set to 0 to disable. -# elasticsearch.shardTimeout: 0 +# Note this should always be lower than "request_timeout". +# Set to 0 to disable (not recommended). +shard_timeout: 30000 -# Time in milliseconds to wait for Elasticsearch at Kibana startup before retrying -# elasticsearch.startupTimeout: 5000 - -# Set the path to where you would like the process id file to be created. -# pid.file: /var/run/kibana.pid - -# If you would like to send the log output to a file you can set the path below. -# logging.dest: stdout - -# Set this to true to suppress all logging output. -# logging.silent: false - -# Set this to true to suppress all logging output except for error messages. -# logging.quiet: false - -# Set this to true to log all events, including system usage information and all requests. -# logging.verbose +# Plugins that are included in the build, and no longer found in the plugins/ folder +bundled_plugin_ids: + - plugins/dashboard/index + - plugins/discover/index + - plugins/doc/index + - plugins/kibana/index + - plugins/metric_vis/index + - plugins/settings/index + - plugins/table_vis/index + - plugins/vis_types/index + - plugins/visualize/index - change group from 'root' to 'kibana' Recipe: * service[kibana] action nothing (skipped due to action :nothing) Recipe: elkstack::kibana * runit_service[kibana] action enable * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/kibana] action create - create new directory /etc/sv/kibana - change mode from '' to '0755' * template[/etc/sv/kibana/run] action create - create new file /etc/sv/kibana/run - update content in file /etc/sv/kibana/run from none to f0df85 --- /etc/sv/kibana/run 2016-08-08 14:37:06.526054407 +0000 +++ /etc/sv/kibana/.chef-run20160808-1550-1kdayoi 2016-08-08 14:37:06.526054407 +0000 @@ -1 +1,8 @@ +#!/bin/sh + +cd /opt/kibana/current +exec 2>&1 + +exec chpst -u kibana /opt/kibana/current/bin/kibana + - change mode from '' to '0755' * directory[/etc/sv/kibana/log] action create - create new directory /etc/sv/kibana/log * directory[/etc/sv/kibana/log/main] action create - create new directory /etc/sv/kibana/log/main - change mode from '' to '0755' * directory[/var/log/kibana] action create - create new directory /var/log/kibana - change mode from '' to '0755' * template[/etc/sv/kibana/log/config] action create - create new file /etc/sv/kibana/log/config - update content in file /etc/sv/kibana/log/config from none to e3b0c4 (no diff) - change mode from '' to '0644' * link[/var/log/kibana/config] action create - create symlink at /var/log/kibana/config to /etc/sv/kibana/log/config * template[/etc/sv/kibana/log/run] action create - create new file /etc/sv/kibana/log/run - update content in file /etc/sv/kibana/log/run from none to e64148 --- /etc/sv/kibana/log/run 2016-08-08 14:37:07.070054407 +0000 +++ /etc/sv/kibana/log/.chef-run20160808-1550-1346g2v 2016-08-08 14:37:07.070054407 +0000 @@ -1 +1,3 @@ +#!/bin/sh +exec svlogd -tt ./main - change mode from '' to '0755' * directory[/etc/sv/kibana/env] action create - create new directory /etc/sv/kibana/env - change mode from '' to '0755' * ruby_block[zap extra env files for kibana service] action run (skipped due to only_if) * template[/etc/sv/kibana/check] action create (skipped due to only_if) * template[/etc/sv/kibana/finish] action create (skipped due to only_if) * directory[/etc/sv/kibana/control] action create - create new directory /etc/sv/kibana/control - change mode from '' to '0755' * link[/etc/init.d/kibana] action create - create symlink at /etc/init.d/kibana to /usr/bin/sv * file[/etc/sv/kibana/down] action nothing (skipped due to action :nothing) * ruby_block[restart_service] action run * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/kibana] action create (up to date) * template[/etc/sv/kibana/run] action create (up to date) * directory[/etc/sv/kibana/log] action create (up to date) * directory[/etc/sv/kibana/log/main] action create (up to date) * directory[/var/log/kibana] action create (up to date) * template[/etc/sv/kibana/log/config] action create (up to date) * link[/var/log/kibana/config] action create (up to date) * template[/etc/sv/kibana/log/run] action create (up to date) * directory[/etc/sv/kibana/env] action create (up to date) * ruby_block[zap extra env files for kibana service] action run (skipped due to only_if) * template[/etc/sv/kibana/check] action create (skipped due to only_if) * template[/etc/sv/kibana/finish] action create (skipped due to only_if) * directory[/etc/sv/kibana/control] action create (up to date) * link[/etc/init.d/kibana] action create (up to date) * file[/etc/sv/kibana/down] action nothing (skipped due to action :nothing) * directory[/etc/service] action create (up to date) * link[/etc/service/kibana] action create - create symlink at /etc/service/kibana to /etc/sv/kibana * ruby_block[wait for kibana service socket] action run - execute the ruby block wait for kibana service socket - execute the ruby block restart_service * ruby_block[restart_log_service] action run * ruby_block[restart_service] action nothing (skipped due to action :nothing) * ruby_block[restart_log_service] action nothing (skipped due to action :nothing) * directory[/etc/sv/kibana] action create (up to date) * template[/etc/sv/kibana/run] action create (up to date) * directory[/etc/sv/kibana/log] action create (up to date) * directory[/etc/sv/kibana/log/main] action create (up to date) * directory[/var/log/kibana] action create (up to date) * template[/etc/sv/kibana/log/config] action create (up to date) * link[/var/log/kibana/config] action create (up to date) * template[/etc/sv/kibana/log/run] action create (up to date) * directory[/etc/sv/kibana/env] action create (up to date) * ruby_block[zap extra env files for kibana service] action run (skipped due to only_if) * template[/etc/sv/kibana/check] action create (skipped due to only_if) * template[/etc/sv/kibana/finish] action create (skipped due to only_if) * directory[/etc/sv/kibana/control] action create (up to date) * link[/etc/init.d/kibana] action create (up to date) * file[/etc/sv/kibana/down] action nothing (skipped due to action :nothing) * directory[/etc/service] action create (up to date) * link[/etc/service/kibana] action create (up to date) * ruby_block[wait for kibana service socket] action run - execute the ruby block wait for kibana service socket - execute the ruby block restart_log_service * directory[/etc/service] action create (up to date) * link[/etc/service/kibana] action create (up to date) * ruby_block[wait for kibana service socket] action run - execute the ruby block wait for kibana service socket * kibana_web[kibana] action create Recipe: ohai::default * remote_directory[/etc/chef/ohai_plugins for cookbook ohai] action create - create new directory /etc/chef/ohai_plugins - change mode from '' to '0755' Recipe: * cookbook_file[/etc/chef/ohai_plugins/README] action create - create new file /etc/chef/ohai_plugins/README - update content in file /etc/chef/ohai_plugins/README from none to 775fa7 --- /etc/chef/ohai_plugins/README 2016-08-08 14:37:13.470054407 +0000 +++ /etc/chef/ohai_plugins/.chef-README20160808-1550-4xhfg7 2016-08-08 14:37:13.450054407 +0000 @@ -1 +1,2 @@ +This directory contains custom plugins for Ohai. - change mode from '' to '0644' Recipe: ohai::default * ohai[custom_plugins] action reload[2016-08-08T14:37:13+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. [2016-08-08T14:37:14+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. - re-run ohai and merge results into node attributes - create resource kibana Recipe: nginx::ohai_plugin * ohai[reload_nginx] action nothing (skipped due to action :nothing) * template[/etc/chef/ohai_plugins/nginx.rb] action create - create new file /etc/chef/ohai_plugins/nginx.rb - update content in file /etc/chef/ohai_plugins/nginx.rb from none to 9f7e82 --- /etc/chef/ohai_plugins/nginx.rb 2016-08-08 14:37:47.382054407 +0000 +++ /etc/chef/ohai_plugins/.chef-nginx.rb20160808-1550-19gl9fm 2016-08-08 14:37:47.382054407 +0000 @@ -1 +1,67 @@ +# +# Author:: Jamie Winsor () +# +# Copyright 2012, Riot Games +# +# 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. +# + +provides "nginx" +provides "nginx/version" +provides "nginx/configure_arguments" +provides "nginx/prefix" +provides "nginx/conf_path" + +def parse_flags(flags) + prefix = nil + conf_path = nil + + flags.each do |flag| + case flag + when /^--prefix=(.+)$/ + prefix = $1 + when /^--conf-path=(.+)$/ + conf_path = $1 + end + end + + [ prefix, conf_path ] +end + +nginx Mash.new unless nginx +nginx[:version] = nil unless nginx[:version] +nginx[:configure_arguments] = Array.new unless nginx[:configure_arguments] +nginx[:prefix] = nil unless nginx[:prefix] +nginx[:conf_path] = nil unless nginx[:conf_path] + +status, stdout, stderr = run_command(:no_status_check => true, :command => "/usr/sbin/nginx -V") + +if status == 0 + stderr.split("\n").each do |line| + case line + when /^configure arguments:(.+)/ + # This could be better: I'm splitting on configure arguments which removes them and also + # adds a blank string at index 0 of the array. This is why we drop index 0 and map to + # add the '--' prefix back to the configure argument. + nginx[:configure_arguments] = $1.split(/\s--/).drop(1).map { |ca| "--#{ca}" } + + prefix, conf_path = parse_flags(nginx[:configure_arguments]) + + nginx[:prefix] = prefix + nginx[:conf_path] = conf_path + when /^nginx version: nginx\/(\d+\.\d+\.\d+)/ + nginx[:version] = $1 + end + end +end - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' * ohai[reload_nginx] action reload[2016-08-08T14:37:47+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. [2016-08-08T14:37:47+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. [2016-08-08T14:37:47+00:00] WARN: [DEPRECATION] Plugin at /etc/chef/ohai_plugins/nginx.rb is a version 6 plugin. Version 6 plugins will not be supported in future releases of Ohai. Please upgrade your plugin to version 7 plugin syntax. For more information visit here: docs.chef.io/ohai_custom.html [2016-08-08T14:37:48+00:00] WARN: Ohai::Mixin::Command run_command is deprecated and will be removed in Ohai 9.0.0 [2016-08-08T14:37:48+00:00] WARN: Ohai::Mixin::Command popen4 is deprecated and will be removed in Ohai 9.0.0 - re-run ohai and merge results into node attributes Recipe: ohai::default * remote_directory[/etc/chef/ohai_plugins for cookbook ohai] action nothing (skipped due to action :nothing) * ohai[custom_plugins] action nothing (skipped due to action :nothing) Recipe: nginx::package * apt_package[nginx] action install - install version 1.4.6-1ubuntu3.5 of package nginx Recipe: nginx::ohai_plugin * ohai[reload_nginx] action reload[2016-08-08T14:40:25+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. [2016-08-08T14:40:25+00:00] WARN: Ohai::Config[:plugin_path] is set. Ohai::Config[:plugin_path] is deprecated and will be removed in future releases of ohai. Use ohai.plugin_path in your configuration file to configure :plugin_path for ohai. [2016-08-08T14:40:25+00:00] WARN: [DEPRECATION] Plugin at /etc/chef/ohai_plugins/nginx.rb is a version 6 plugin. Version 6 plugins will not be supported in future releases of Ohai. Please upgrade your plugin to version 7 plugin syntax. For more information visit here: docs.chef.io/ohai_custom.html [2016-08-08T14:40:27+00:00] WARN: Ohai::Mixin::Command run_command is deprecated and will be removed in Ohai 9.0.0 [2016-08-08T14:40:27+00:00] WARN: Ohai::Mixin::Command popen4 is deprecated and will be removed in Ohai 9.0.0 - re-run ohai and merge results into node attributes Recipe: nginx::package * service[nginx] action enable (up to date) Recipe: nginx::commons_dir * directory[/etc/nginx] action create (up to date) * directory[/var/log/nginx] action create (up to date) * directory[/run] action create (up to date) * directory[/etc/nginx/sites-available] action create (up to date) * directory[/etc/nginx/sites-enabled] action create (up to date) * directory[/etc/nginx/conf.d] action create (up to date) Recipe: nginx::commons_script * template[/usr/sbin/nxensite] action create - create new file /usr/sbin/nxensite - update content in file /usr/sbin/nxensite from none to fa46fb --- /usr/sbin/nxensite 2016-08-08 14:40:29.158054407 +0000 +++ /usr/sbin/.chef-nxensite20160808-1550-1wqhke8 2016-08-08 14:40:29.158054407 +0000 @@ -1 +1,39 @@ +#!/bin/sh -e + +SYSCONFDIR='/etc/nginx' + +if [ -z $1 ]; then + echo "Which site would you like to enable?" + echo -n "Your choices are: " + ls $SYSCONFDIR/sites-available/* | \ + sed -e "s,$SYSCONFDIR/sites-available/,,g" | xargs echo + echo -n "Site name? " + read SITENAME +else + SITENAME=$1 +fi + +if [ $SITENAME = "default" ]; then + PRIORITY="000" +fi + +if [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \ + -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then + echo "This site is already enabled!" + exit 0 +fi + +if ! [ -e $SYSCONFDIR/sites-available/$SITENAME ]; then + echo "This site does not exist!" + exit 1 +fi + +if [ $SITENAME = "default" ]; then + ln -sf $SYSCONFDIR/sites-available/$SITENAME \ + $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" +else + ln -sf $SYSCONFDIR/sites-available/$SITENAME $SYSCONFDIR/sites-enabled/$SITENAME +fi + +echo "Site $SITENAME installed; reload nginx to enable." - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' * template[/usr/sbin/nxdissite] action create - create new file /usr/sbin/nxdissite - update content in file /usr/sbin/nxdissite from none to cc16ec --- /usr/sbin/nxdissite 2016-08-08 14:40:29.266054407 +0000 +++ /usr/sbin/.chef-nxdissite20160808-1550-1qngv5u 2016-08-08 14:40:29.266054407 +0000 @@ -1 +1,30 @@ +#!/bin/sh -e + +SYSCONFDIR='/etc/nginx' + +if [ -z $1 ]; then + echo "Which site would you like to disable?" + echo -n "Your choices are: " + ls $SYSCONFDIR/sites-enabled/* | \ + sed -e "s,$SYSCONFDIR/sites-enabled/,,g" | xargs echo + echo -n "Site name? " + read SITENAME +else + SITENAME=$1 +fi + +if [ $SITENAME = "default" ]; then + PRIORITY="000" +fi + +if ! [ -e $SYSCONFDIR/sites-enabled/$SITENAME -o \ + -e $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" ]; then + echo "This site is already disabled, or does not exist!" + exit 1 +fi + +if ! rm $SYSCONFDIR/sites-enabled/$SITENAME 2>/dev/null; then + rm -f $SYSCONFDIR/sites-enabled/"$PRIORITY"-"$SITENAME" +fi +echo "Site $SITENAME disabled; reload nginx to disable." - change mode from '' to '0755' - change owner from '' to 'root' - change group from '' to 'root' Recipe: nginx::commons_conf * template[nginx.conf] action create - update content in file /etc/nginx/nginx.conf from 9492ca to e61f6c --- /etc/nginx/nginx.conf 2014-03-04 22:25:36.000000000 +0000 +++ /etc/nginx/.chef-nginx.conf20160808-1550-budwch 2016-08-08 14:40:29.498054407 +0000 @@ -1,96 +1,48 @@ user www-data; -worker_processes 4; -pid /run/nginx.pid; +worker_processes 1; +error_log /var/log/nginx/error.log; +pid /run/nginx.pid; + events { - worker_connections 768; - # multi_accept on; + worker_connections 1024; } http { - ## - # Basic Settings - ## + include /etc/nginx/mime.types; + default_type application/octet-stream; - sendfile on; - tcp_nopush on; - tcp_nodelay on; - keepalive_timeout 65; - types_hash_max_size 2048; - # server_tokens off; - # server_names_hash_bucket_size 64; - # server_name_in_redirect off; + access_log /var/log/nginx/access.log; - include /etc/nginx/mime.types; - default_type application/octet-stream; + sendfile on; + tcp_nopush on; + tcp_nodelay on; - ## - # Logging Settings - ## + keepalive_requests 100; + keepalive_timeout 65; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; - ## - # Gzip Settings - ## + gzip on; + gzip_http_version 1.0; + gzip_comp_level 2; + gzip_proxied any; + gzip_vary off; + gzip_types text/plain text/css application/x-javascript text/xml application/xml application/rss+xml application/atom+xml text/javascript application/javascript application/json text/mathml; + gzip_min_length 1000; + gzip_disable "MSIE [1-6]\."; - gzip on; - gzip_disable "msie6"; - # gzip_vary on; - # gzip_proxied any; - # gzip_comp_level 6; - # gzip_buffers 16 8k; - # gzip_http_version 1.1; - # gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; + variables_hash_max_size 1024; + variables_hash_bucket_size 64; + server_names_hash_bucket_size 128; + types_hash_max_size 2048; + types_hash_bucket_size 64; - ## - # nginx-naxsi config - ## - # Uncomment it if you installed nginx-naxsi - ## - #include /etc/nginx/naxsi_core.rules; - ## - # nginx-passenger config - ## - # Uncomment it if you installed nginx-passenger - ## - - #passenger_root /usr; - #passenger_ruby /usr/bin/ruby; - - ## - # Virtual Host Configs - ## - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; + include /etc/nginx/conf.d/*.conf; + include /etc/nginx/sites-enabled/*; } - - -#mail { -# # See sample authentication script at: -# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript -# -# # auth_http localhost/auth.php; -# # pop3_capabilities "TOP" "USER"; -# # imap_capabilities "IMAP4rev1" "UIDPLUS"; -# -# server { -# listen localhost:110; -# protocol pop3; -# proxy on; -# } -# -# server { -# listen localhost:143; -# protocol imap; -# proxy on; -# } -#} * template[/etc/nginx/sites-available/default] action create - update content in file /etc/nginx/sites-available/default from cda500 to 1ac789 --- /etc/nginx/sites-available/default 2014-03-04 22:25:36.000000000 +0000 +++ /etc/nginx/sites-available/.chef-default20160808-1550-1vagd6w 2016-08-08 14:40:29.698054407 +0000 @@ -1,113 +1,12 @@ -# You may add here your -# server { -# ... -# } -# statements for each of your virtual hosts to this file - -## -# You should look at the following URL's in order to grasp a solid understanding -# of Nginx configuration files in order to fully unleash the power of Nginx. -# http://wiki.nginx.org/Pitfalls -# http://wiki.nginx.org/QuickStart -# http://wiki.nginx.org/Configuration -# -# Generally, you will want to move this file somewhere, and start with a clean -# file but keep this around for reference. Or just disable in sites-enabled. -# -# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. -## - server { - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; + listen 80; + server_name default-ubuntu-1404; - root /usr/share/nginx/html; - index index.html index.htm; + access_log /var/log/nginx/localhost.access.log; - # Make site accessible from http://localhost/ - server_name localhost; - - location / { - # First attempt to serve request as file, then - # as directory, then fall back to displaying a 404. - try_files $uri $uri/ =404; - # Uncomment to enable naxsi on this location - # include /etc/nginx/naxsi.rules - } - - # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests - #location /RequestDenied { - # proxy_pass http://127.0.0.1:8080; - #} - - #error_page 404 /404.html; - - # redirect server error pages to the static page /50x.html - # - #error_page 500 502 503 504 /50x.html; - #location = /50x.html { - # root /usr/share/nginx/html; - #} - - # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 - # - #location ~ \.php$ { - # fastcgi_split_path_info ^(.+\.php)(/.+)$; - # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini - # - # # With php5-cgi alone: - # fastcgi_pass 127.0.0.1:9000; - # # With php5-fpm: - # fastcgi_pass unix:/var/run/php5-fpm.sock; - # fastcgi_index index.php; - # include fastcgi_params; - #} - - # deny access to .htaccess files, if Apache's document root - # concurs with nginx's one - # - #location ~ /\.ht { - # deny all; - #} + location / { + root /var/www/nginx-default; + index index.html index.htm; + } } - - -# another virtual host using mix of IP-, name-, and port-based configuration -# -#server { -# listen 8000; -# listen somename:8080; -# server_name somename alias another.alias; -# root html; -# index index.html index.htm; -# -# location / { -# try_files $uri $uri/ =404; -# } -#} - - -# HTTPS server -# -#server { -# listen 443; -# server_name localhost; -# -# root html; -# index index.html index.htm; -# -# ssl on; -# ssl_certificate cert.pem; -# ssl_certificate_key cert.key; -# -# ssl_session_timeout 5m; -# -# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; -# ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES"; -# ssl_prefer_server_ciphers on; -# -# location / { -# try_files $uri $uri/ =404; -# } -#} * execute[nxdissite default] action run - execute /usr/sbin/nxdissite default Recipe: nginx::default * service[nginx] action start (up to date) * template[/etc/nginx/sites-available/kibana] action create - create new file /etc/nginx/sites-available/kibana - update content in file /etc/nginx/sites-available/kibana from none to 24dd2a --- /etc/nginx/sites-available/kibana 2016-08-08 14:40:30.186054407 +0000 +++ /etc/nginx/sites-available/.chef-kibana20160808-1550-rsur8o 2016-08-08 14:40:30.186054407 +0000 @@ -1 +1,28 @@ +server { + listen 80; + listen 443 ssl; + + server_name default-ubuntu-1404 ; + access_log /var/log/nginx/default-ubuntu-1404.access.log; + + ssl_certificate_key /etc/nginx/ssl/kibana.key; + ssl_certificate /etc/nginx/ssl/kibana.pem; + + if ( $scheme = http ){ + rewrite ^ https://default-ubuntu-1404$request_uri? permanent; + } + + location / { + proxy_pass http://localhost:5601; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_read_timeout 90; + + # Password protect Kibana + auth_basic "Restricted Access"; + auth_basic_user_file /etc/nginx/htpassword; + } + +} Recipe: * execute[nxensite kibana] action run - execute /usr/sbin/nxensite kibana Recipe: elkstack::kibana * service[nginx] action nothing (skipped due to action :nothing) * file[/etc/nginx/conf.d/default.conf] action delete (skipped due to only_if) Recipe: elkstack::kibana_monitoring * rackspace_monitoring_service[default] action create (skipped due to only_if) * rackspace_monitoring_service[default] action start (skipped due to only_if) * rackspace_monitoring_check[nginx_service] action create (skipped due to only_if) Recipe: rsyslog::default * apt_package[rsyslog] action install (up to date) * directory[/etc/rsyslog.d] action create (up to date) * log[adm] action write * directory[/var/spool/rsyslog] action create (up to date) * execute[validate_config] action nothing (skipped due to action :nothing) * template[/etc/rsyslog.conf] action create - update content in file /etc/rsyslog.conf from af7e2f to b8ba4a --- /etc/rsyslog.conf 2014-08-19 19:51:16.000000000 +0000 +++ /etc/.chef-rsyslog.conf20160808-1550-u3fxp2 2016-08-08 14:40:31.418054407 +0000 @@ -1,30 +1,32 @@ -# /etc/rsyslog.conf Configuration file for rsyslog. +# Config generated by Chef - manual edits will be overwritten # -# For more information see -# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html +# /etc/rsyslog.conf Configuration file for rsyslog. # +# For more information see +# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html +# # Default logging rules can be found in /etc/rsyslog.d/50-default.conf +# +# Set hostname +# +# +# Set max message size +# +$MaxMessageSize 2k +# +# Preserve FQDN +# +$PreserveFQDN off ################# #### MODULES #### ################# -$ModLoad imuxsock # provides support for local system logging -$ModLoad imklog # provides kernel logging support -#$ModLoad immark # provides --MARK-- message capability +$ModLoad imuxsock +$ModLoad imklog -# provides UDP syslog reception -#$ModLoad imudp -#$UDPServerRun 514 -# provides TCP syslog reception -#$ModLoad imtcp -#$InputTCPServerRun 514 - -# Enable non-kernel facility klog messages -$KLogPermitNonKernelFacility on - ########################### #### GLOBAL DIRECTIVES #### ########################### @@ -39,6 +41,11 @@ $RepeatedMsgReduction on # +# Set temporary directory to buffer syslog queue +# +$WorkDirectory /var/spool/rsyslog + +# # Set the default permissions for all log files. # $FileOwner syslog @@ -50,13 +57,11 @@ $PrivDropToGroup syslog # -# Where to place spool and state files +# Set other directives # -$WorkDirectory /var/spool/rsyslog # # Include all config files in /etc/rsyslog.d/ # $IncludeConfig /etc/rsyslog.d/*.conf - * template[/etc/rsyslog.d/50-default.conf] action create - update content in file /etc/rsyslog.d/50-default.conf from e85a0e to a14e35 --- /etc/rsyslog.d/50-default.conf 2013-04-18 16:19:02.000000000 +0000 +++ /etc/rsyslog.d/.chef-50-default.conf20160808-1550-14raxq1 2016-08-08 14:40:31.578054407 +0000 @@ -1,69 +1,19 @@ -# Default rules for rsyslog. -# -# For more information see rsyslog.conf(5) and /etc/rsyslog.conf +# Generated by Chef +# For more information see rsyslog.conf(5) and /etc/rsyslog.conf -# -# First some standard log files. Log by facility. -# -auth,authpriv.* /var/log/auth.log -*.*;auth,authpriv.none -/var/log/syslog -#cron.* /var/log/cron.log -#daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -#lpr.* -/var/log/lpr.log -mail.* -/var/log/mail.log -#user.* -/var/log/user.log - -# -# Logging for the mail system. Split it up so that -# it is easy to write scripts to parse these files. -# -#mail.info -/var/log/mail.info -#mail.warn -/var/log/mail.warn -mail.err /var/log/mail.err - -# -# Logging for INN news system. -# -news.crit /var/log/news/news.crit -news.err /var/log/news/news.err -news.notice -/var/log/news/news.notice - -# -# Some "catch-all" log files. -# -#*.=debug;\ -# auth,authpriv.none;\ -# news.none;mail.none -/var/log/debug -#*.=info;*.=notice;*.=warn;\ -# auth,authpriv.none;\ -# cron,daemon.none;\ -# mail,news.none -/var/log/messages - -# -# Emergencies are sent to everybody logged in. -# -*.emerg :omusrmsg:* - -# -# I like to have messages displayed on the console, but only on a virtual -# console I usually leave idle. -# -#daemon,mail.*;\ -# news.=crit;news.=err;news.=notice;\ -# *.=debug;*.=info;\ -# *.=notice;*.=warn /dev/tty8 - -# The named pipe /dev/xconsole is for the `xconsole' utility. To use it, -# you must invoke `xconsole' with the `-file' option: -# -# $ xconsole -file /dev/xconsole [...] -# -# NOTE: adjust the list below, or you'll go crazy if you have a reasonably -# busy site.. -# -daemon.*;mail.*;\ - news.err;\ - *.=debug;*.=info;\ - *.=notice;*.=warn |/dev/xconsole +auth,authpriv.* /var/log/auth.log +*.*;auth,authpriv.none -/var/log/syslog +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log +mail.info -/var/log/mail.info +mail.warn -/var/log/mail.warn +mail.err /var/log/mail.err +news.crit /var/log/news/news.crit +news.err /var/log/news/news.err +news.notice -/var/log/news/news.notice +*.=debug;auth,authpriv.none;news.none;mail.none -/var/log/debug +*.=info;*.=notice;*.=warn;auth,authpriv.none;cron,daemon.none;mail,news.none -/var/log/messages +*.emerg :omusrmsg:* * service[rsyslog] action enable (up to date) * service[rsyslog] action start (up to date) Recipe: rsyslog::client * template[/etc/rsyslog.d/49-remote.conf] action create - create new file /etc/rsyslog.d/49-remote.conf - update content in file /etc/rsyslog.d/49-remote.conf from none to c18669 --- /etc/rsyslog.d/49-remote.conf 2016-08-08 14:40:32.182054407 +0000 +++ /etc/rsyslog.d/.chef-49-remote.conf20160808-1550-1rdu2co 2016-08-08 14:40:32.182054407 +0000 @@ -1 +1,9 @@ +# Generated by Chef +$ActionQueueType LinkedList # use asynchronous processing +$ActionQueueFileName srvrfwd # set file name, also enables disk mode +$ActionResumeRetryCount -1 # infinite retries on insert failure +$ActionQueueSaveOnShutdown on # save in-memory data if rsyslog shuts down +$ActionQueueMaxDiskSpace 1G # Don't use more than this much space for the queue + +*.* @@127.0.0.1:5959 - change mode from '' to '0644' - change owner from '' to 'root' - change group from '' to 'root' * file[/etc/rsyslog.d/server.conf] action delete (up to date) Recipe: firewall::default * firewall[default] action restart (skipped due to only_if) (skipped due to only_if) * file[/etc/iptables/rules.v4] action create - update content in file /etc/iptables/rules.v4 from 0b3ce3 to 56ab69 --- /etc/iptables/rules.v4 2016-08-08 14:25:07.649808408 +0000 +++ /etc/iptables/.chef-rules.v420160808-1550-43pyf9 2016-08-08 14:40:32.726054407 +0000 @@ -1,8 +1,21 @@ -# Generated by iptables-save v1.4.21 on Mon Aug 8 14:25:07 2016 +# position 1 *filter -:INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] +# position 2 +:INPUT DROP +# position 3 +:FORWARD DROP +# position 4 +:OUTPUT ACCEPT +# position 50 +-A INPUT -p tcp -m tcp -m multiport --dports 22 -m comment --comment "allow world to ssh" -j ACCEPT +-A INPUT -m state --state RELATED,ESTABLISHED -m comment --comment "established" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5959 -m comment --comment "allow syslog entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5960 -m comment --comment "allow lumberjack entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5961 -m comment --comment "allow tcp entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 443 -m comment --comment "allow nginx SSL entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 80 -m comment --comment "allow nginx entries inbound" -j ACCEPT +-A INPUT -p udp -m multiport --dports 5962 -m comment --comment "allow udp entries inbound" -j ACCEPT +-A INPUT -i lo -j ACCEPT -m comment --comment "allow services on loopback to talk to any interface" +# position 100 COMMIT -# Completed on Mon Aug 8 14:25:07 2016 * file[/etc/iptables/rules.v6] action create - update content in file /etc/iptables/rules.v6 from 38d600 to ef8393 --- /etc/iptables/rules.v6 2016-08-08 14:25:07.745856408 +0000 +++ /etc/iptables/.chef-rules.v620160808-1550-1e4qffw 2016-08-08 14:40:32.762054407 +0000 @@ -1,8 +1,21 @@ -# Generated by ip6tables-save v1.4.21 on Mon Aug 8 14:25:07 2016 +# position 1 *filter -:INPUT ACCEPT [0:0] -:FORWARD ACCEPT [0:0] -:OUTPUT ACCEPT [0:0] +# position 2 +:INPUT DROP +# position 3 +:FORWARD DROP +# position 4 +:OUTPUT ACCEPT +# position 50 +-A INPUT -m state --state RELATED,ESTABLISHED -m comment --comment "established" -j ACCEPT +-A INPUT -p ipv6-icmp -m comment --comment "ipv6_icmp" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5959 -m comment --comment "allow syslog entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5960 -m comment --comment "allow lumberjack entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 5961 -m comment --comment "allow tcp entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 443 -m comment --comment "allow nginx SSL entries inbound" -j ACCEPT +-A INPUT -p tcp -m tcp -m multiport --dports 80 -m comment --comment "allow nginx entries inbound" -j ACCEPT +-A INPUT -p udp -m multiport --dports 5962 -m comment --comment "allow udp entries inbound" -j ACCEPT +-A INPUT -i lo -j ACCEPT -m comment --comment "allow services on loopback to talk to any interface" +# position 100 COMMIT -# Completed on Mon Aug 8 14:25:07 2016 Recipe: elkstack::elasticsearch * service[elasticsearch] action start (up to date) Recipe: elkstack::logstash * logstash_service[server] action restart * runit_service[logstash_server] action restart ================================================================================ Error executing action `restart` on resource 'runit_service[logstash_server]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ Expected process to exit with [0], but received '1' ---- Begin output of /usr/bin/sv restart /etc/service/logstash_server ---- STDOUT: timeout: run: /etc/service/logstash_server: (pid 21322) 611s, got TERM STDERR: ---- End output of /usr/bin/sv restart /etc/service/logstash_server ---- Ran /usr/bin/sv restart /etc/service/logstash_server returned 1 Cookbook Trace: --------------- /tmp/kitchen/cache/cookbooks/runit/libraries/helpers.rb:173:in `restart_service' /tmp/kitchen/cache/cookbooks/runit/libraries/provider_runit_service.rb:328:in `block in ' /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb:224:in `service_action' /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb:42:in `block in class_from_file' /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action' Resource Declaration: --------------------- # In /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb 222: sv = runit_service svc[:service_name] 223: end Compiled Resource: ------------------ # Declared in /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb:222:in `service_action' runit_service("logstash_server") do provider Chef::Provider::RunitService action :enable updated true supports {:restart=>true, :reload=>true, :status=>true} retries 0 retry_delay 2 default_guard_interpreter :default service_name "logstash_server" pattern "logstash_server" status_command "/usr/bin/sv status /etc/service" sv_bin "/usr/bin/sv" sv_dir "/etc/sv" service_dir "/etc/service" lsb_init_dir "/etc/init.d" options {:name=>"server", :home=>"/opt/logstash/server", :max_heap=>"97M", :min_heap=>"97M", :gc_opts=>nil, :java_opts=>"", :ipv4_only=>false, :debug=>false, :log_file=>"logstash.log", :workers=>1, :install_type=>"tarball", :supervisor_gid=>"logstash", :user=>"logstash", :web_address=>nil, :web_port=>nil} log true cookbook "logstash" restart_on_update true run_template_name "logstash" log_template_name "logstash" check_script_template_name "logstash_server" finish_script_template_name "logstash_server" sv_templates true log_dir "/var/log/logstash_server" service_mirror # Declared in service("logstash_server") do provider Chef::Provider::Service::Simple action [:nothing] supports {:restart=>true, :reload=>true, :status=>true} retries 0 retry_delay 2 default_guard_interpreter :default service_name "logstash_server" pattern "logstash_server" start_command "/usr/bin/sv start /etc/service/logstash_server" stop_command "/usr/bin/sv stop /etc/service/logstash_server" status_command "/usr/bin/sv status /etc/service/logstash_server" restart_command "/usr/bin/sv restart /etc/service/logstash_server" end declared_type :runit_service cookbook_name "elkstack" end Platform: --------- x86_64-linux ================================================================================ Error executing action `restart` on resource 'logstash_service[server]' ================================================================================ Mixlib::ShellOut::ShellCommandFailed ------------------------------------ runit_service[logstash_server] (/tmp/kitchen/cache/cookbooks/logstash/providers/service.rb line 222) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of /usr/bin/sv restart /etc/service/logstash_server ---- STDOUT: timeout: run: /etc/service/logstash_server: (pid 21322) 611s, got TERM STDERR: ---- End output of /usr/bin/sv restart /etc/service/logstash_server ---- Ran /usr/bin/sv restart /etc/service/logstash_server returned 1 Cookbook Trace: --------------- /tmp/kitchen/cache/cookbooks/runit/libraries/helpers.rb:173:in `restart_service' /tmp/kitchen/cache/cookbooks/runit/libraries/provider_runit_service.rb:328:in `block in ' /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb:224:in `service_action' /tmp/kitchen/cache/cookbooks/logstash/providers/service.rb:42:in `block in class_from_file' /tmp/kitchen/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action' Resource Declaration: --------------------- # In /tmp/kitchen/cache/cookbooks/elkstack/recipes/logstash.rb 19: logstash_service instance_name do 20: action :enable 21: end 22: Compiled Resource: ------------------ # Declared in /tmp/kitchen/cache/cookbooks/elkstack/recipes/logstash.rb:19:in `from_file' logstash_service("server") do action [:enable] retries 0 retry_delay 2 default_guard_interpreter :default declared_type :logstash_service cookbook_name "elkstack" recipe_name "logstash" instance "server" end Platform: --------- x86_64-linux Recipe: elkstack::kibana * runit_service[kibana] action restart (up to date) Recipe: nginx::default * service[nginx] action reload - reload service service[nginx] Recipe: rsyslog::default * execute[validate_config] action run - execute rsyslogd -N 1 -f /etc/rsyslog.conf * service[rsyslog] action restart - restart service service[rsyslog] * service[iptables-persistent] action restart - restart service service[iptables-persistent] * service[iptables-persistent] action restart - restart service service[iptables-persistent] Running handlers: [2016-08-08T14:40:57+00:00] ERROR: Running exception handlers Running handlers complete [2016-08-08T14:40:57+00:00] ERROR: Exception handlers complete Chef Client failed. 184 resources updated in 21 minutes 51 seconds [2016-08-08T14:40:57+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out [2016-08-08T14:40:57+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report [2016-08-08T14:40:57+00:00] ERROR: logstash_service[server] (elkstack::logstash line 19) had an error: Mixlib::ShellOut::ShellCommandFailed: runit_service[logstash_server] (/tmp/kitchen/cache/cookbooks/logstash/providers/service.rb line 222) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' ---- Begin output of /usr/bin/sv restart /etc/service/logstash_server ---- STDOUT: timeout: run: /etc/service/logstash_server: (pid 21322) 611s, got TERM STDERR: ---- End output of /usr/bin/sv restart /etc/service/logstash_server ---- Ran /usr/bin/sv restart /etc/service/logstash_server returned 1 [2016-08-08T14:42:19+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1) >>>>>> ------Exception------- >>>>>> Class: Kitchen::ActionFailed >>>>>> Message: 1 actions failed. >>>>>> Converge failed on instance . Please see .kitchen/logs/default-ubuntu-1404.log for more details >>>>>> ---------------------- >>>>>> Please see .kitchen/logs/kitchen.log for more details >>>>>> Also try running `kitchen diagnose --all` for configuration