Skip to content

Instantly share code, notes, and snippets.

@lamont-granquist
lamont-granquist / resources.md
Last active August 17, 2023 22:29
Three Ways to Write Correct Chef Resources

This has been moved into the official Chef docs:

https://docs.chef.io/custom_resources_notes.html

12.5 style custom resources

This is by far the most recommended way of writing resources for all users. There are two gotchas which we're working through:

  1. For helper functions that you used to write in your provider code or used to mixin to your provider code, you have to use an action_class do ... end block.
@coderanger
coderanger / berks-api-lite.rb
Created October 30, 2014 23:42
Berks API Lite.
#!/usr/bin/env ruby
require 'json'
require 'openssl'
require 'tempfile'
require 'fog'
BUCKET = 'something'
ROOT = File.expand_path('..', __FILE__)
UNIVERSE = {}