Skip to content

Instantly share code, notes, and snippets.

@atomic-penguin
atomic-penguin / Berksfile_chef_server.rb
Last active August 29, 2015 13:56
Berksfile use case examples
# Default source in this mode is my chef-Server which acts as an artifact repo
# for cookbooks which passed testing.
# Read ~/.berkshelf/config.json for chef-server location.
chef_api :config
# Get list of cookbooks from metadata
metadata
# Pin fix for cookbook foobar
@atomic-penguin
atomic-penguin / chef_sshkey.rb
Created February 4, 2014 04:51
Generate deploy key for Jenkins with Chef and sshkey gem.
# Install sshkey gem into chef
chef_gem 'sshkey'
# Base location of ssh key
pkey = node['jenkins']['master']['home'] + '/.ssh/id_rsa'
# Generate a keypair with Ruby
require 'sshkey'
sshkey = SSHKey.generate(
type: 'RSA',
http://vialstudios.com/guide-authoring-cookbooks.html
http://vialstudios.logdown.com/posts/166848-the-environment-cookbook-pattern
http://www.youtube.com/watch?v=hYt0E84kYUI
http://www.youtube.com/watch?v=SYZ2GzYAw_Q
http://foodfightshow.org/
@atomic-penguin
atomic-penguin / test_kitchen.debug.bash
Last active January 4, 2016 10:29
test-kitchen-failure
[jenkins@ci mu-jenkins-kitchen]$ kitchen converge default-centos-64 -l debug
-----> Starting Kitchen (v1.1.1)
D [kitchen::driver::vagrant command] BEGIN (vagrant --version)
D [kitchen::driver::vagrant command] END (0m0.33s)
-----> Creating <default-centos-64>...
D <default-centos-64> is synchronizing on Kitchen::Driver::Vagrant#create
D <default-centos-64> is messaging Kitchen::Driver::Vagrant#create
D Creating Vagrantfile for <default-centos-64> (/var/lib/jenkins/workspace/mu-jenkins-kitchen/.kitchen/kitchen-vagrant/default-centos-64/Vagrantfile)
D ------------
D Vagrant.configure("2") do |c|
@atomic-penguin
atomic-penguin / config.json
Created January 22, 2014 05:00
~/.berkshelf/config.json Basically, you need just this in a file to get past SSL verification errors with berkshelf.
{
"ssl":{
"verify":false
}
}
@atomic-penguin
atomic-penguin / el5_cpu_hot_add.md
Last active December 30, 2015 09:19
Centos/EL5 CPU hot add

CentOS/EL5 CPU hot add

VMWare allows you to hot add vCPUs to RHEL 5.5 and newer machines. However, you have to tell the OS to pick up the added vCPUs.

Enabling CPU hot add in VMWare

In the VMWare vSphere client, click Edit Settings on the Virtual Machine to open the Properties dialog. Next, go to the Options tab, find the Advanced->Memory/CPU Hotplug section, and select the radio button next to Enable CPU hot add only for this virtual machine. CPU hot add and remove is not yet supported on RHEL5, according to the Redhat KB article 15523.

You will have to reboot the Virtual Machine after enabling CPU hot add, to enable this option in the VM's BIOS.

"lsb": {
"id": "Fedora",
"description": "Fedora release 19 (Schrödinger’s Cat)",
"release": "19",
"codename": "Schrödinger’sCat"
}
"platform": "fedora",
"platform_version": "19",
"platform_family": "fedora",
@atomic-penguin
atomic-penguin / kitchen-backtrace.sh
Created July 24, 2013 18:55
test kitchen / vagrant bailout Fedora 19
[wolfe21@wolfe21-ig88 mumail]$ kitchen test -d never
-----> Starting Kitchen (v1.0.0.beta.1)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ShellOut::ShellCommandFailed
>>>>>> Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT:
STDERR: /opt/vagrant/embedded/gems/gems/vagrant-1.2.4/plugins/hosts/fedora/host.rb:15:in `block in match?': invalid byte sequence in US-ASCII (ArgumentError)
from /opt/vagrant/embedded/gems/gems/vagrant-1.2.4/plugins/hosts/fedora/host.rb:14:in `open'
from /opt/vagrant/embedded/gems/gems/vagrant-1.2.4/plugins/hosts/fedora/host.rb:14:in `open'
%w{ package-one package-two package-three etc }.each do |pkg|
package pkg
source "/tmp/rpm/php53"
end
end
---
driver_plugin: vagrant
driver_config:
destroy: never
parallel: true
platforms:
- name: ubuntu-12.04
driver_config:
box: canonical-ubuntu-12.04