Hi Mark,

what you are doing is basically possibl. You just need to get the Syntax right. I've added the necessary changes inline below.


If you follow this pattern, you'll also note that this maps directly to the possibilities of an external node script should you need one in the future.


On 4/14/2010 2:47 PM, Mark Nelson wrote:
Hello

I am trying to use tags to differentiate between machines that are
servers and machines that are clients. I am using the tag statement
within the node definition as shown below -

node shadow inherits default
{
tag("server")
}

node shadow {

        $server = true

        include default
}

The default node is defined as follows -

node default

class default
{
include "root-ssh-key"
include "dns"
include "puppet"
include "sshd"
include "autofs"
}


Within the class definition I am testing to see if the machine has been
tagged as a server and setting variables accordingly.

class autofs
{
if tagged(server)
if $server
{
$auto_master="puppet://puppet/files/common/etc/auto.master.server"
$auto_mt="puppet://puppet/files/common/etc/auto.master.server"
$auto_home="puppet://puppet/files/common/etc/auto.home.server"
}
else
{
$auto_master="puppet://puppet/files/common/etc/auto.master.laptop"
$auto_mt="puppet://puppet/files/common/etc/auto.master.laptop"
}

file
{
"/etc/auto.master":

source => $auto_master,
owner => "root",
group => "root",
mode => "444",
notify => Service["autofs"];
}
}


Best Regards, David
--
dasz.at OG              Tel: +43 (0)664 2602670     Web: http://dasz.at
Klosterneuburg                                         UID: ATU64260999

       FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to