Skip to content

Instantly share code, notes, and snippets.

@fujin
Created October 10, 2008 08:53
Show Gist options
  • Select an option

  • Save fujin/16018 to your computer and use it in GitHub Desktop.

Select an option

Save fujin/16018 to your computer and use it in GitHub Desktop.
#
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment