Guest User

Untitled

a guest
Feb 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #
  2. # Set up our puppet environment
  3. #
  4.  
  5. unless attrib?("puppet_env")
  6. hostname = attrib?("hostname")
  7. fqdn = attrib?("fqdn")
  8. if fqdn =~ /amazonaws.com$/
  9. replace_attrib("puppet_env", "prod")
  10. else
  11. if hostname =~ /^.+?\d+(.+)$/
  12. replace_attrib("puppet_env", $1)
  13. else
  14. replace_attrib("puppet_env", "prod")
  15. end
  16. end
  17. end
Add Comment
Please, Sign In to add comment