Skip to content

Instantly share code, notes, and snippets.

View reset's full-sized avatar

Jamie Stormbreaker reset

View GitHub Profile
def find_memcached_nodes
find_nodes_with_role('enmasse_online_memcached', node.chef_environment)
end
def find_nodes_with_role(role, environment)
return [node] if node.chef_environment == 'development'
results = search(:node, "role:#{role} AND chef_environment:#{environment}")
if node.run_list.roles.include?(role)
results << node
end
upstream enmasse_online_mogilefs {
server 10.0.2.15:7001;
server 10.0.2.16:7001;
}
location /datastore/videos/ {
access_log off;
expires 365d;
mogilefs_domain enmasse_online_development;
{
"vagrant": false,
"merlin": {
"version": "merlin-1.13.0.ac692b2"
},
"run_list": [
"recipe[merlin::chef_server_rubygems_install]",
"role[merlin_chef_server]",
"role[merlin_database_master]",
"role[merlin_redis_server]",
provides "ipaddress"
provides "macaddress"
require_plugin "network"
ip, mac = find_ip_and_mac(network["interfaces"]["eth1"]["addresses"])
ipaddress ip
macaddress mac
# Pre 1.9.x syntax
{
:first_key => "first value"
}
{
"first_key" => "first_value"
}
# Don't know if you'd have to initialize it here
arbitrary_sql = nil
ruby_block "read sql file" do
block do
arbitrary_sql = ::File.open("/opt/sl/rtview.sql").read
end
end
mysql_database "create tables" do
include_recipe "pvpnet_core::platform_auth"
include_recipe "pvpnet_core::store_processor"
include_recipe "pvpnet_core::community"
include_recipe "pvpnet_core::login_queue"
include_recipe "pvpnet_core::loyalty_processor"
include_recipe "pvpnet_core::partner_processor"
include_recipe "pvpnet_core::csr_services"
~/code/riot-cookbooks/artifact (master ✘)✹✭ ᐅ bundle exec berks in --shims tmp/asdff
Using artifact (0.10.0) at path: '/Users/reset/code/riot-cookbooks/artifact'
Installing ark (0.0.10) from git: 'git://github.com/bryanwb/chef-ark.git' with branch '721692625e1bff6f651f1032ef14adf355dc216b'
Installing java (1.4.3) from git: 'git://github.com/bryanwb/java.git' with branch '8576a1b3a65599bfe50e49f462921071a2e04cb0'
WARNING: Skipping shim for artifact (0.10.0) '/Users/reset/code/riot-cookbooks/artifact'.
WARNING: Cannot write the shim of a source with a path location into a subdirectory of itself.
Shims written to: 'tmp/asdff'
git node[:rbenv][:root] do
repository node[:rbenv][:git_repository]
reference node[:rbenv][:git_revision]
user "rbenv"
group "rbenv"
action :sync
notifies :create, "ruby_block[init_rbenv_env]", :immediately
end
module Some
class Application < Celluloid::SupervisionGroup
supervise Some::Component, as: :some_component
end
end
config = Some::Config.new
Some::Application.run!(config)