logo       

Boolean expressions: msg#00297

sysutils.puppet.user

Subject: Boolean expressions

I'm trying to write a wrapper definition for the file type to make it a
bit smarter. I have a basic version working fairly well:

define xfile($owner = root, $group = root, $mode = 644, $source,
$backup = main, $recurse = false, $ensure = file) {
file { $name:
mode => $mode,
owner => $owner,
group => $group,
backup => $backup,
recurse => $recurse,
ensure => $ensure,
source => [ "puppet://$server/dist/$source.$host",
"puppet://$server/dist/$source.$operatingsystem",
"puppet://$server/dist/$source"
}
}

The big hitch now is that FreeBSD, of course, doesn't do the "root"
group. It wants "wheel". So I figure what I want to do is take a look
at $group and $operatingsystem, and if need be translate "root" to
"wheel". I really don't want to be specifying the group on every file.

The docco is somewhat lacking in describing syntax for boolean
expressions for "if" statements, so I've been trying to figure out how
to express that. None of the obvious things I can think of work. Hint?

Matt


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise