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

Commit

Permalink
Setup A record for instances where node['cloud_v2'] is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Kottler committed Jul 3, 2014
1 parent 2e37b7d commit 085f34b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Berksfile.lock
Expand Up @@ -239,7 +239,7 @@ GRAPH
rubygems-backups (>= 0.0.0)
rubygems-fail2ban (0.0.2)
fail2ban (>= 0.0.0)
rubygems-hostname (0.1.9)
rubygems-hostname (0.1.10)
chef-vault (>= 0.0.0)
dwradcliffe-dnsimple (>= 0.0.0)
hostname (>= 0.0.0)
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/rubygems-hostname/metadata.rb
Expand Up @@ -2,7 +2,7 @@
maintainer 'RubyGems.org Ops Team'
license 'MIT'
description 'Set the hostname of RubyGems.org machines using node.name'
version '0.1.9'
version '0.1.10'

depends 'chef-vault'
depends 'dwradcliffe-dnsimple'
Expand Down
10 changes: 10 additions & 0 deletions cookbooks/rubygems-hostname/recipes/dns.rb
Expand Up @@ -19,4 +19,14 @@
password dnsimple_credentials['password']
action :create
end
else
dwradcliffe_dnsimple_record "create A record for #{node.name}" do
name node.name.sub('.rubygems.org', '')
content `/usr/bin/curl http://169.254.169.254/latest/meta-data/public-ipv4`.chomp

This comment has been minimized.

Copy link
@dwradcliffe

dwradcliffe Jul 3, 2014

Member

What happened to the ohai plugin?

This comment has been minimized.

Copy link
@skottler

skottler Jul 3, 2014

Member

Ha, I figured this would come up. I'm going to remove it since it doesn't actually provide much data and this is frankly less abstracted, which makes more sense IMO.

type 'A'
domain 'rubygems.org'
username dnsimple_credentials['username']
password dnsimple_credentials['password']
action :create
end
end

0 comments on commit 085f34b

Please sign in to comment.