This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remote_file "/tmp/nagios_libexec.tar.gz" do | |
source "#{node[:app][:remote_resource]}/nagios/nagios_libexec.tar.gz" | |
mode "0644" | |
action :create_if_missing | |
end | |
bash "Unpack libexec" do | |
cwd "/home/nagios/libexec" | |
code <<-EOH | |
rm -rf /home/nagios/libexec/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bash "Add nagios group to AllowGroups in sshd_config" do | |
user "root" | |
code <<-EOH | |
sed -i 's/\(^AllowGroups.*\)/\1 nagios/' /etc/ssh/sshd_config | |
/sbin/service sshd restart | |
EOH | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remote_file "/tmp/apache-tomcat-#{node[:tomcat][:version]}.tar.gz" do | |
source "#{node[:app][:remote_resource]}/apache-tomcat-#{node[:tomcat][:version]}.tar.gz" | |
mode "0644" | |
action :create_if_missing | |
notifies :run, "bash[Unpack Tomcat]", :immediately | |
notifies :create, "link[#{tomcat_dir}/default]", :immediately | |
end | |
bash "Unpack Tomcat" do | |
cwd "#{tomcat_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Script for pushing logs to s3 | |
# | |
#require 'rubygems' | |
#require 'yaml' | |
require 'fog' | |
config_file = File.join(File.dirname(__FILE__),"logmoverconfig.yml") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The following is for a chef-client 0.10.8 run | |
This is what it says in chef wiki concerning the service resource (http://wiki.opscode.com/display/chef/Resources#Resources-Service): | |
:status - the init script or other service provider can use a status command to determine if the service is running. If this is not specified, Chef will attempt to match the service_name against the process table as a regular expression, unless pattern is specified as a parameter attribute. | |
I have a service who's init script isn't proper so it doesn't support chkconfig, status, etc. It will eventually be fixed but not now. In the mean time it doesn't appear as if chef is doing what the wiki says it'll do. | |
Here's the resource from the recipe: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is what I have in my recipe: | |
bash "Set newrelic java options" do | |
user "root" | |
group "root" | |
cwd glassfishconfig | |
code <<-EOH | |
awk -v searchterm="<java-config" -v payload=" <jvm-options>-javaagent:#{newrelic_dir}/newrelic-#{node[:newrelic][:version]}/newrelic.jar</jvm-options>\n <jvm-options>-Dnewrelic.config.file=#{newrelic_dir}/#{node[:app][:key]}/newrelic.yml</jvm-options>\n <jvm-options>-Dnewrelic.config.log_file_path=#{newrelic_dir}/#{node[:app][:key]}/logs</jvm-options>" '{ if ($0 ~ searchterm) print $0 "\n" payload; else print $0 }' domain.xml.newrelic.bak > domain.xml | |
EOH | |
action :nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NoMethodError: gem_package[fog] (s3_file::default line 27) had an error: NoMethodError: undefined method `full_name' for nil:NilClass | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `block in gather_dependencies' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `map' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `gather_dependencies' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:169:in `block (2 levels) in install' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:192:in `with_correct_verbosity' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:168:in `block in install' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:103:in `with_gem_sources' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:167:in `install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo cat /var/chef/cache/chef-stacktrace.out | |
Generated at 2012-12-03 16:41:30 -0700 | |
NoMethodError: gem_package[fog] (s3_file::default line 27) had an error: NoMethodError: undefined method `full_name' for nil:NilClass | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `block in gather_dependencies' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `map' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:136:in `gather_dependencies' | |
/usr/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:267:in `install' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:169:in `block (2 levels) in install' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:192:in `with_correct_verbosity' | |
/usr/lib/ruby/gems/1.9.1/gems/chef-10.12.0/lib/chef/provider/package/rubygems.rb:168:in `block in install' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = execute "yum install -y -q libxml2 libxml2-devel libxslt libxslt-devel" do | |
action :nothing | |
end | |
e.run_action(:run) | |
g = gem_package "fog" do | |
version "1.1.2" | |
action :nothing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IFS=: | |
while read -r name data; do | |
if [[ "$data" =~ CRLF ]]; then | |
dos2unix $name | |
fi | |
done < <(find . -type f -exec file {} \;) | |
unset IFS |
OlderNewer