Environments by facter

18 views
Skip to first unread message

mahmed

unread,
Aug 10, 2015, 12:37:32 PM8/10/15
to Puppet Users
Hi,

Need some help, currently have puppet setup with custom fact defined as like below, what i want to do is setup my environments in puppet based on this custom fact, how easily can i do this, anyone?

Facter.add('web_environment') do
  setcode do
    case Facter.value(:hostname)
    when /host01|host02/
      "test"
    when /host03|host04/
      "staging"
    when /host09|host19/
      "live"
    ........
    ............
    .............. 

Cheers
mahmed
Reply all
Reply to author
Forward
0 new messages