Skip to content

Instantly share code, notes, and snippets.

@nathenharvey
Forked from SaschaMoellering/logfile
Last active December 29, 2015 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathenharvey/7621004 to your computer and use it in GitHub Desktop.
Save nathenharvey/7621004 to your computer and use it in GitHub Desktop.
default[:vertx][:version] = '2.0.2'
default[:vertx][:home] = '/srv/vertx'
default[:vertx][:url] = 'http://dl.bintray.com/vertx/downloads/'
#
# Cookbook Name:: vertx
# Recipe:: default
#
# Copyright 2013, ZANOX.de AG
#
# All rights reserved - Do Not Redistribute
#
include_recipe "java"
include_recipe "ark"
package "authbind" do
action :install
end
bash "configure_authbind" do
code <<-EOS
touch /etc/authbind/byport/80
chown vertx:vertx /etc/authbind/byport/80
chmod 755 /etc/authbind/byport/80
EOS
not_if {File.exists?("/etc/authbind/byport/80")}
end
ark "vertx" do
url node[:vertx][:url] + "vert.x-" + node[:vertx][:version] + "-final.zip"
home_dir node[:vertx][:home]
version node[:vertx][:version]
append_env_path true
action :install
end
%w{ logs deploy deploy/packages }.each do |dir|
directory "/srv/#{dir}" do
owner "vertx"
group "vertx"
recursive true
end
end
case node['platform']
when "debian"
template "/etc/default/vertx" do
source "vertx_config.erb"
mode "0644"
owner "vertx"
group "vertx"
not_if "test -f /etc/default/vertx"
end
when "centos"
template "/etc/sysconfig/vertx" do
source "vertx_config.erb"
mode "0644"
owner "vertx"
group "vertx"
not_if "test -f /etc/sysconfig/vertx"
end
end
case node['platform']
when "debian"
template "/etc/default/vertx_deploy" do
source "vertx_deploy.erb"
mode "0644"
owner "vertx"
group "vertx"
not_if "test -f /etc/default/vertx_deploy"
end
when "centos"
template "/etc/sysconfig/vertx_deploy" do
source "vertx_deploy.erb"
mode "0644"
owner "vertx"
group "vertx"
not_if "test -f /etc/sysconfig/vertx_deploy"
end
end
template "/etc/init.d/vertx" do
source "vertx_runlevel.erb"
mode "0755"
owner "root"
group "root"
end
%w{conf bin}.each do |subdir|
directory "#{node[:vertx][:home]}/#{subdir}" do
owner "vertx"
group "vertx"
recursive true
end
end
template node[:vertx][:home] + "/conf/cluster.xml" do
source "cluster_xml.erb"
mode "0644"
owner "vertx"
group "vertx"
end
template node[:vertx][:home] + "/conf/repos.txt" do
source "repos_txt.erb"
mode "0644"
owner "vertx"
group "vertx"
end
template node[:vertx][:home] + "/conf/logging.properties" do
source "logging_properties.erb"
mode "0644"
owner "vertx"
group "vertx"
end
template node[:vertx][:home] + "/bin/vertx" do
source "vertx.erb"
mode "0755"
owner "vertx"
group "vertx"
end
template node[:vertx][:home] + "/bin/vertx_status" do
source "vertx_status.erb"
mode "0755"
owner "vertx"
group "vertx"
end
service "vertx" do
service_name "vertx"
action [:enable, :start]
end
[2013-11-23T22:36:00+00:00] INFO: *** Chef 10.24.4 ***
[2013-11-23T22:36:00+00:00] INFO: Setting the run_list to ["recipe[vertx]"] from JSON
[2013-11-23T22:36:00+00:00] INFO: Run List is [recipe[vertx]]
[2013-11-23T22:36:00+00:00] INFO: Run List expands to [vertx]
[2013-11-23T22:36:00+00:00] INFO: Starting Chef Run for debian-squeeze.caris.de
[2013-11-23T22:36:00+00:00] INFO: Running start handlers
[2013-11-23T22:36:00+00:00] INFO: Start handlers complete.
[2013-11-23T22:36:00+00:00] INFO: group[vertx] created
[2013-11-23T22:36:00+00:00] INFO: user[vertx] created
[2013-11-23T22:36:00+00:00] INFO: ruby_block[set-env-java-home] called
[2013-11-23T22:36:01+00:00] INFO: entered create
[2013-11-23T22:36:01+00:00] INFO: file[/etc/profile.d/jdk.sh] mode changed to 755
[2013-11-23T22:36:01+00:00] INFO: file[/etc/profile.d/jdk.sh] created file /etc/profile.d/jdk.sh
[2013-11-23T22:36:01+00:00] INFO: Adding jdk to /usr/lib/jvm/jdk1.7.0_25
[2013-11-23T22:37:38+00:00] INFO: template[/usr/lib/jvm/.java-7-oracle.jinfo] updated content
[2013-11-23T22:38:19+00:00] INFO: bash[configure_authbind] ran successfully
[2013-11-23T22:38:19+00:00] INFO: directory[/usr/local/vertx-2.0.2] created directory /usr/local/vertx-2.0.2
[2013-11-23T22:38:29+00:00] INFO: remote_file[/var/chef/cache/vertx.zip] updated
[2013-11-23T22:38:29+00:00] INFO: remote_file[/var/chef/cache/vertx.zip] not queuing delayed action run on execute[unpack /var/chef/cache/vertx.zip] (delayed), as it's already been queued
[2013-11-23T22:38:29+00:00] INFO: link[/srv/vertx] created
[2013-11-23T22:38:29+00:00] INFO: template[/etc/profile.d/vertx.sh] updated content
[2013-11-23T22:38:29+00:00] INFO: template[/etc/profile.d/vertx.sh] owner changed to 0
[2013-11-23T22:38:29+00:00] INFO: template[/etc/profile.d/vertx.sh] group changed to 0
[2013-11-23T22:38:29+00:00] INFO: template[/etc/profile.d/vertx.sh] mode changed to 755
[2013-11-23T22:38:29+00:00] INFO: ruby_block[adding '/usr/local/vertx-2.0.2/bin' to chef-client ENV['PATH']] called
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/logs] created directory /srv/logs
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/logs] owner changed to 1009
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/logs] group changed to 1009
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy] created directory /srv/deploy
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy] owner changed to 1009
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy] group changed to 1009
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy/packages] created directory /srv/deploy/packages
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy/packages] owner changed to 1009
[2013-11-23T22:38:29+00:00] INFO: directory[/srv/deploy/packages] group changed to 1009
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx] updated content
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx] owner changed to 1009
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx] group changed to 1009
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx] mode changed to 644
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx_deploy] updated content
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx_deploy] owner changed to 1009
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx_deploy] group changed to 1009
[2013-11-23T22:38:29+00:00] INFO: template[/etc/default/vertx_deploy] mode changed to 644
[2013-11-23T22:38:29+00:00] INFO: template[/etc/init.d/vertx] updated content
[2013-11-23T22:38:29+00:00] INFO: template[/etc/init.d/vertx] owner changed to 0
[2013-11-23T22:38:29+00:00] INFO: template[/etc/init.d/vertx] group changed to 0
[2013-11-23T22:38:29+00:00] INFO: template[/etc/init.d/vertx] mode changed to 755
================================================================================
Error executing action `create` on resource 'template[/srv/vertx/conf/cluster.xml]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
Parent directory /srv/vertx/conf does not exist.
Resource Declaration:
---------------------
# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/vertx/recipes/install.rb
87: template node[:vertx][:home] + "/conf/cluster.xml" do
88: source "cluster_xml.erb"
89: mode "0644"
90: owner "vertx"
91: group "vertx"
92: end
93:
Compiled Resource:
------------------
# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/vertx/recipes/install.rb:87:in `from_file'
template("/srv/vertx/conf/cluster.xml") do
provider Chef::Provider::Template
action "create"
retries 0
retry_delay 2
path "/srv/vertx/conf/cluster.xml"
backup 5
source "cluster_xml.erb"
cookbook_name :vertx
recipe_name "install"
mode "0644"
owner "vertx"
group "vertx"
end
[2013-11-23T22:38:29+00:00] ERROR: Running exception handlers
[2013-11-23T22:38:29+00:00] ERROR: Exception handlers complete
[2013-11-23T22:38:29+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-11-23T22:38:29+00:00] FATAL: Chef::Exceptions::EnclosingDirectoryDoesNotExist: template[/srv/vertx/conf/cluster.xml] (vertx::install line 87) had an error: Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory /srv/vertx/conf does not exist.
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment