Skip to content

Instantly share code, notes, and snippets.

@dblessing
dblessing / onename.md
Created August 10, 2016 13:57
onename.md
@dblessing
dblessing / keybase.md
Created August 9, 2016 15:19
keybase.md

Keybase proof

I hereby claim:

  • I am dblessing on github.
  • I am dblessing (https://keybase.io/dblessing) on keybase.
  • I have a public key whose fingerprint is A53F C75D A219 796B C39B D241 2138 605A 5CB3 454E

To claim this, I am signing this object:

2015-09-02T08:34:50-05:00] DEBUG: Initiating POST to https://chef.example.com/organizations/my_org/reports/nodes/provisioner.example.com/runs/3080062f-e231-4770-b16b-81a30c5503f3
[2015-09-02T08:34:50-05:00] DEBUG: ---- HTTP Request Header Data: ----
[2015-09-02T08:34:50-05:00] DEBUG: X-Ops-Reporting-Protocol-Version: 0.1.0
[2015-09-02T08:34:50-05:00] DEBUG: Content-Encoding: gzip
[2015-09-02T08:34:50-05:00] DEBUG: X-OPS-SIGN: algorithm=sha1;version=1.0;
[2015-09-02T08:34:50-05:00] DEBUG: X-OPS-USERID: provisioner.example.com
[2015-09-02T08:34:50-05:00] DEBUG: X-OPS-TIMESTAMP: 2015-09-02T13:34:49Z
[2015-09-02T08:34:50-05:00] DEBUG: HOST: chef.example.com:443
[2015-09-02T08:34:50-05:00] DEBUG: X-Ops-Server-API-Version: 1
[2015-09-02T08:34:50-05:00] DEBUG: X-REMOTE-REQUEST-ID: 3080062f-e231-4770-b16b-81a30c5503f3
$ berks
Resolving cookbook dependencies...
Fetching 'apache_tomcat' from source at .
Fetching 'apache_tomcat_test' from source at test/fixtures/cookbooks/apache_tomcat_test
Fetching 'poise' from gem from poise
Fetching cookbook index from Halite gems...
Fetching cookbook index from https://supermarket.chef.io...
/opt/chefdk/embedded/lib/ruby/site_ruby/2.1.0/rubygems/dependency.rb:45:in `initialize': dependency name must be a String, was #<Gem::StubSpecification:0x007f817418d948 @loaded_from="/opt/chefdk/embedded/lib/ruby/gems/2.1.0/specifications/CFPropertyList-2.3.1.gemspec", @extension_dir=nil, @extensions_dir=nil, @full_gem_path="/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems/CFPropertyList-2.3.1", @gem_dir=nil, @gems_dir="/opt/chefdk/embedded/lib/ruby/gems/2.1.0/gems", @base_dir="/opt/chefdk/embedded/lib/ruby/gems/2.1.0", @data=#<Gem::StubSpecification::StubLine:0x007f817418d7e0 @parts=["CFPropertyList", "2.3.1", "ruby", "lib"]>, @extensions=[], @spec=#<Gem::Specification:0x3fc0ba85e480 CFPropertyList-2.3.
@dblessing
dblessing / apache_tomcat_config.rb
Created August 29, 2015 19:56
Poise Subresources
require 'poise'
module ApacheTomcatConfig
class Resource < Chef::Resource
include Poise(container: true, container_namespace: false)
poise_subresource :apache_tomcat_instance
provides :apache_tomcat_config
actions :create
@dblessing
dblessing / `rake spec` exception
Created July 23, 2015 16:27
Halite/Poise Spec Trouble
/opt/chefdk/embedded/bin/ruby -I/Users/drewb/.chefdk/gem/ruby/2.1.0/gems/rspec-support-3.3.0/lib:/Users/drewb/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.3.1/lib /Users/drewb/.chefdk/gem/ruby/2.1.0/gems/rspec-core-3.3.1/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
================================================================================
Error executing action `install` on resource 'apache_tomcat[tomcat]'
================================================================================
NoMethodError
-------------
No resource or method named `ark' for `ApacheTomcat::Provider ""'
#<Cheffish::MergedConfig:0x00000012ce8738 @configs=[
{
:bootstrap_options=>
{
:availability_zone=>"us-east-1a",
:instance_type=>"t2.large",
:iam_instance_profile=>{:name=>"elasticsearch"}
}
},
{
* machine[chef-backend2.example.com] action setup[2015-04-14T22:07:18+00:00] ERROR: Unable to download /etc/chef/client.pem to #<StringIO:0x000000045314f8> on root@chef-backend2.example.com -- Error: command 'cp /etc/chef/client.pem /tmp/client.pem.2307107513' exited with code 1.
[2015-04-14T22:07:18+00:00] WARN: Unable to clean up /tmp/client.pem.2307107513 on root@chef-backend2.example.com -- Error: command 'rm /tmp/client.pem.2307107513' exited with code 1.
Chef::Log.warn("About to backup")
converge_by "backup #{new_resource} before upgrade" do
backup
Chef::Log.info("#{new_resource} backed up gitlab")
end
super
@dblessing
dblessing / gitlab_omnibus_package.rb
Created April 12, 2015 20:13
Custom resource/provider w/ Poise
class Chef
class Resource::GitlabOmnibusPackage < Resource::Package
include Poise
provides :gitlab_omnibus_package
attribute :backup, kind_of: [TrueClass, FalseClass], default: true
# Was previously working without poise w/ follow: