fujin (owner)

Revisions

gist: 16018 Download_button fork
public
Public Clone URL: git://gist.github.com/16018.git
puppet_env.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#
# Set up our puppet environment
#
 
unless attrib?("puppet_env")
  hostname = attrib?("hostname")
  fqdn = attrib?("fqdn")
  if fqdn =~ /amazonaws.com$/
    replace_attrib("puppet_env", "prod")
  else
    if hostname =~ /^.+?\d+(.+)$/
      replace_attrib("puppet_env", $1)
    else
      replace_attrib("puppet_env", "prod")
    end
  end
end