Skip to content

Instantly share code, notes, and snippets.

@sbates
sbates / tomcat_install_provider.rb
Created May 17, 2013 18:34
A first pass at trying to install Tomcat from wherever the hell you please to keep your pkg.
#
# Cookbook Name:: tomcat
# Provider:: install
#
# Author:: Sascha Bates
def load_current_resource
@inst = new_resource.pkg_src
@uid = new_resource.uid || "5001"
@gid = new_resource.gid || "5001"
@sbates
sbates / Berksfile
Created May 30, 2013 18:57
a berksfile for a monitoring cookbook
metadata
cookbook 'runit', '1.1.5', path: '/Users/saschabX/github/runit'
#cookbook 'sensu', git: 'git://github.com/sensu/sensu-chef.git'
cookbook 'sensu', path: '/Users/saschabX/github/sensu-chef'
#cookbook 'redis', git: 'git://github.com/miah/chef-redis'
cookbook 'redis', path: '/Users/saschabX/github/chef-redis'
cookbook 'erlang', path: '/Users/saschabX/github/erlang'
cookbook 'yum', '2.2.3', git: 'git://github.com/opscode-cookbooks/yum.git'
@sbates
sbates / gist:5685872
Last active December 17, 2015 22:59
A discussion on Berkshelf worlfklow
<someara> moin
[08:54:05] <maruq> gkarekinian: haha, probably.
[08:54:20] <maruq> gkarekinian: joining for the "how to cook good" chat?
[08:54:37] <maruq> someara: guten abend!
[08:54:42] <gkarekinian> Sure
[08:55:00] <gkarekinian> "How to avoid burning all your pans and pots"
[08:55:23] <someara> danke
[08:55:24] <maruq> haha!
[08:55:49] <maruq> someara: do you speak ze German, or just know the basics?
[08:55:58] <someara> just the basics
@sbates
sbates / gist:5694606
Created June 2, 2013 19:29
where's the monitor recipe?
vagrant@sensu-lxc-host:/vagrant$ bin/vagabond knife search node "chef_environment:_default AND recipes:monitor\\:\\:master"
ERROR: ArgumentError: Type must be a string or a symbol!
vagrant@sensu-lxc-host:/vagrant$ bin/vagabond knife search node "recipes:monitor\\:\\:master"
ERROR: knife search failed: invalid search query: 'recipes:monitor::master'
vagrant@sensu-lxc-host:/vagrant$ bin/vagabond knife search node "recipes:monitor::master"
ERROR: knife search failed: invalid search query: 'recipes:monitor::master'
vagrant@sensu-lxc-host:/vagrant$ bin/vagabond knife search node "recipes:monitor\:\:master"
ERROR: knife search failed: invalid search query: 'recipes:monitor::master'
vagrant@sensu-lxc-host:/vagrant$ bin/vagabond knife search node "Recipes:monitor\:\:master"
ERROR: knife search failed: invalid search query: 'Recipes:monitor::master'
if (new_resource.use_host_dns)
lxc_fstab "resolv[#{new_resource.name}]" do
container new_resource.name
file_system '/etc/resolv.conf'
mount_point '/etc/resolv.conf'
type 'none'
options 'bind'
end
end
|ruby-1.9.3-p392| macncheese in ~/github/berkshelf
± |master ✓| → bundle exec berks ver
******************
Berkshelf (2.0.0.beta)
******************
Copyright 2012-2013 Riot Games
Jamie Winsor (<reset@riotgames.com>)
Josiah Kiehl (<jkiehl@riotgames.com>)
@sbates
sbates / gist:5723633
Created June 6, 2013 18:10
sad erlang
[vagrant@monitor-berkshelf ~]$ sudo rpm -U /tmp/vagrant-chef-1/rabbitmq-server-3.0.4-1.noarch.rpm
warning: /tmp/vagrant-chef-1/rabbitmq-server-3.0.4-1.noarch.rpm: Header V4 DSA/SHA1 Signature, key ID 056e8e56: NOKEY
error: Failed dependencies:
erlang >= R12B-3 is needed by rabbitmq-server-3.0.4-1.noarch
[vagrant@monitor-berkshelf ~]$ rpm -qa|grep erlang
esl-erlang-R15B03-2.x86_64
bash "update_ssh" do
code <<-EOH
sed -i -e 's/AuthorizedKeysFile.*authorized_keys/AuthorizedKeysFile \\/\\.keys\\/%u\\/authorized_keys/g' /etc/ssh/sshd_config
EOH
end
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
config.vm.hostname = "monitor-berkshelf"
config.omnibus.chef_version = :latest
@sbates
sbates / gist:5985245
Last active December 19, 2015 16:38
esl-erlang still not providing erlang
[root@tomcatty-berkshelf yum.repos.d]# yum install esl-erlang-R15B03
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: centos.hostingxtreme.com
* extras: mirror.fdcservers.net
* rpmforge: mirror.rit.edu
* updates: mirror.ubiquityservers.com
Setting up Install Process
Package esl-erlang-R15B03-2.x86_64 already installed and latest version
Nothing to do