Skip to content

Instantly share code, notes, and snippets.

@atomic-penguin
atomic-penguin / omnibus-python-windows.rb
Last active April 28, 2017 08:53
omnibus-python-windows.rb
#
# Copyright:: Copyright (c) 2013-2014 Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@atomic-penguin
atomic-penguin / kitchen.sh
Created February 12, 2015 02:03
centos-7-curl-ssl-fail
[wolfe21@guri nfs]$ kitchen test centos-7
-----> Starting Kitchen (v1.3.1)
-----> Cleaning up any prior instances of <default-centos-70>
-----> Destroying <default-centos-70>...
Finished destroying <default-centos-70> (0m0.00s).
-----> Testing <default-centos-70>
-----> Creating <default-centos-70>...
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'opscode-centos-7.0' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
  1. Install packer
  2. git clone git@github.com:joefitzgerald/packer-windows.git
  3. cd packer-windows
  4. packer build windows_2012_r2.json
@atomic-penguin
atomic-penguin / spec_helper.rb
Last active August 29, 2015 14:04 — forked from hartmantis/spec_helper.rb
A spec helper library to stub recipes into isolation
require 'chefspec'
module SpecHelper
def global_stubs
# Don't worry about external cookbook dependencies
Chef::Cookbook::Metadata.any_instance.stub(:depends)
# Test each recipe in isolation, regardless of includes
@included_recipes = []
Chef::RunContext.any_instance.stub(:loaded_recipe?).and_return(false)
---
provisioner:
name: chef_zero
driver:
@atomic-penguin
atomic-penguin / postconf.sh
Created May 1, 2014 15:01
postconf 450 vs 550 defaults
[root@mail ~]# postconf -d | grep 550
multi_recipient_bounce_reject_code = 550
unknown_local_recipient_reject_code = 550
unknown_relay_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
[root@mail ~]# postconf -d | grep 450
access_map_defer_code = 450
defer_code = 450
@atomic-penguin
atomic-penguin / kitchen.log
Last active August 29, 2015 14:00
Include no such method
I, [2014-04-22T12:20:39.494519 #30918] INFO -- default-centos-65: -----> Converging <default-centos-65>...
I, [2014-04-22T12:20:39.496360 #30918] INFO -- default-centos-65: Preparing files for transfer
I, [2014-04-22T12:20:39.501174 #30918] INFO -- default-centos-65: Resolving cookbook dependencies with Berkshelf 2.0.14...
I, [2014-04-22T12:20:40.864417 #30918] INFO -- default-centos-65: Removing non-cookbook files before transfer
I, [2014-04-22T12:20:41.301089 #30918] INFO -- default-centos-65: Transfering files to <default-centos-65>
I, [2014-04-22T12:20:49.504787 #30918] INFO -- default-centos-65: [2014-04-22T19:20:49+00:00] INFO: Starting chef-zero on port 8889 with repository at repository at /tmp/kitchen
I, [2014-04-22T12:20:49.504918 #30918] INFO -- default-centos-65: One version per cookbook
I, [2014-04-22T12:20:49.504962 #30918] INFO -- default-centos-65:
I, [2014-04-22T12:20:49.519963 #30918] INFO -- default-centos-65: [2014-04-22T19:20:49+00:00] INFO: Forking chef instance to converge..
@atomic-penguin
atomic-penguin / python_pip_spec.rb
Created March 26, 2014 20:46
python_pip_spec.rb
it 'installs python package foo with pip' do
expect(chef_run).to install_python_pip('foo')
end
@atomic-penguin
atomic-penguin / .kitchen.yml
Last active August 29, 2015 13:57
.kitchen.yml two suites
suites:
- name: default
run_list:
- recipe[foo]
- name: integration
run_list:
- recipe[base]
- recipe[foo]
@atomic-penguin
atomic-penguin / Rakefile.rb
Created February 13, 2014 23:57
Example chefspec rake task
# chefspec task against spec/*_spec.rb
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:chefspec)