Skip to content

Instantly share code, notes, and snippets.

View cheeseplus's full-sized avatar
🎯
Focusing

Seth Thomas cheeseplus

🎯
Focusing
View GitHub Profile
@cheeseplus
cheeseplus / vagrant_spec.rb
Created January 5, 2017 17:01
spec/kitchen/driver/vagrant_spec.rb
--- a/spec/kitchen/driver/vagrant_spec.rb
+++ b/spec/kitchen/driver/vagrant_spec.rb
@@ -1081,14 +1081,7 @@ describe Kitchen::Driver::Vagrant do
config[:box_check_update] = false
cmd
- expect(vagrantfile).to match(regexify(%{c.vm.box_check_update = "false"}))
- end
-
- it "sets vm.box_check_update if :box_check_update is set" do
---
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
- name: ubuntu-14.04
driver:
test.rb -l info
[2016-09-15T12:40:53-04:00] INFO: Run List is []
[2016-09-15T12:40:53-04:00] INFO: Run List expands to []
[2016-09-15T12:40:53-04:00] INFO: [:enable]
Recipe: (chef-apply cookbook)::(chef-apply recipe)
* ruby_block[config mount actions] action run[2016-09-15T12:40:53-04:00] INFO: Processing ruby_block[config mount actions] action run ((chef-apply cookbook)::(chef-apply recipe) line 3)
[2016-09-15T12:40:53-04:00] INFO: ruby_block[config mount actions] called
- execute the ruby block config mount actions
* log[test that actions was appended to] action write[2016-09-15T12:40:53-04:00] INFO: Processing log[test that actions was appended to] action write ((chef-apply cookbook)::(chef-apply recipe) line 9)
JSON of:
{
"buildkite" : {
"user" : "vagrant",
"group" : "wheel"
}
}
results in:
@cheeseplus
cheeseplus / default.rb
Last active September 6, 2016 18:12
repro for template
node.default['ip'] = '173.194.207.113'
template '/tmp/template_hack' do
source 'template.erb'
owner 'root'
group 'root'
mode 00744
end
Recipe: audit::default
* compliance_profile[ssh] action fetch
* chef_gem[inspec] action install (up to date)
- install/update inspec
* directory[/var/chef/cache/compliance] action create (up to date)
- create cache directory
================================================================================
Error executing action `fetch` on resource 'compliance_profile[ssh]'
================================================================================
STDERR: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
service hostname start
Stdout from the command:
Stderr from the command:
unless node['chef_client'].nil? or node['chef_client']['tomcat_restart'].nil?
ruby_block "Check if Tomcat need to restart" do
block do
if node['chef_client']['tomcat_restart'] != 0
node.normal['chef_client']['tomcat_restart'] = node['chef_client']['tomcat_restart'] - 1
resources(:service => "tomcat6").run_action(:restart)
end
end
end
end
#!/bin/bash
# Fix from HipChat Forums Anonymous User
# https://help.hipchat.com/forums/138883-suggestions-ideas/suggestions/5830763-ubuntu-notifications-sounds-not-working
# THis should be run as root or via sudo
# locate libcanberra-pulse.so
pulse_lib=$(locate libcanberra-pulse.so)
# find dirname
canberra_dir=$(dirname ${pulse_lib})
Namespace isn't correct and it was set as an array not a hash
default['logstash']['instance']['agent']['inputs'] = {
:file => {
:type => "jboss",
:path => "/app/jboss/standalone/log/server.log",
:start_position => "beginning"
}
}