Skip to content
This repository has been archived by the owner on Jul 11, 2020. It is now read-only.

Commit

Permalink
add meg commands
Browse files Browse the repository at this point in the history
dwradcliffe committed Jul 18, 2014

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 96c8e76 commit 60bd6c4
Showing 5 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Original file line number Diff line number Diff line change
@@ -265,7 +265,7 @@ GRAPH
slack_handler (>= 0.0.0)
rubygems-ntp (0.0.1)
ntp (>= 0.0.0)
rubygems-people (0.0.22)
rubygems-people (0.0.26)
sudo (>= 0.0.0)
user (>= 0.0.0)
rubygems-redis (0.0.3)
2 changes: 1 addition & 1 deletion cookbooks/rubygems-people/metadata.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
maintainer 'RubyGems.org Ops Team'
license 'MIT'
description 'RubyGems user recipes'
version '0.0.22'
version '0.0.26'

depends 'user'
depends 'sudo'
9 changes: 8 additions & 1 deletion cookbooks/rubygems-people/recipes/default.rb
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@

include_recipe 'user'

meg_balancer_host = search(:node, "roles:balancer AND chef_environment:#{node.chef_environment}")[0]['ipaddress']
meg_app_host = search(:node, "roles:app AND chef_environment:#{node.chef_environment}")[0]['ipaddress']

users = data_bag('users')
sysadmins = []
users.each do |user_name|
@@ -31,7 +34,9 @@
owner user['username']
group user['username']
variables(
environment: node.chef_environment
environment: node.chef_environment,
meg_balancer_host: meg_balancer_host,
meg_app_host: meg_app_host
)
end

@@ -49,3 +54,5 @@

node.default['authorization']['sudo']['groups'] = ['sysadmin']
include_recipe 'sudo'

include_recipe 'rubygems-people::meg'
14 changes: 14 additions & 0 deletions cookbooks/rubygems-people/recipes/meg.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Cookbook Name:: rubygems-bastion
# Recipe:: meg
#

git '/opt/meg' do
repository 'https://github.com/rubygems/meg'
reference 'chef'
action :sync
end

link '/usr/bin/meg' do
to '/opt/meg/bin/meg'
end
4 changes: 4 additions & 0 deletions cookbooks/rubygems-people/templates/default/bashrc.erb
Original file line number Diff line number Diff line change
@@ -95,3 +95,7 @@ if ! shopt -oq posix; then
. /etc/bash_completion
fi
fi

# export hostnames for use in meg commands
export MEG_BALANCER_HOST=<%= @meg_balancer_host %>
export MEG_APP_HOST=<%= @meg_app_host %>

0 comments on commit 60bd6c4

Please sign in to comment.