Puppet: System Administration Automated

Checking whether classes have been evaluated


Another snippet I used for testing.

Bug #1165 requests the ability to check for whether a class exists, but we've already got that:

class yay {
    notify { "This is a test": }
}

class other {
    if defined(Class[yay]) {
        notify { "Defined works just fine": }
    }
}

include yay, other

Prints:

notice: This is a test
notice: Defined works just fine

Works for me. :)

add to del.icio.us Add to Blinkslist add to furl Digg it add to ma.gnolia Stumble It! add to simpy seed the vine TailRank post to facebook

Thu, 03 Apr 2008 | Tags: , , ,