You can use:
resources{host: purge => true}

HOWEVER! this will delete any non manged resource in your /etc/hosts! handle
with care.

Ohad

On Thu, Sep 3, 2009 at 10:07 AM, ELTigre <igalva...@gmail.com> wrote:

>
> Umm...thanks  joseph, but I see things begins to complicate because I
> don't know how to make this template :-(
> I though I'd resolve my problem with some resources.
>
> regards,
> Israel.
>
> On Sep 2, 8:50 pm, joseph.e.mcdon...@gmail.com wrote:
> > You'd want to change your idea into a file resource with the content
> parameter set to a template. In the template you can access the variables to
> set up that line properly. Of course if you need to add more hosts to a
> system it will be sort of a pita.
> > Sent from my Verizon Wireless BlackBerry
> >
> > -----Original Message-----
> > From: ELTigre <igalva...@gmail.com>
> >
> > Date: Wed, 2 Sep 2009 18:42:37
> > To: Puppet Users<puppet-users@googlegroups.com>
> > Subject: [Puppet Users] Re: Host type usage
> >
> > A question:
> >
> > I want to make a class to delete all lines (if any) in /etc/hosts and
> > add this two new lines:
> >
> > class hosts {
> >
> >  host { "$hostname":
> >       ensure => present,
> >       ip => "$ipaddress",
> >       alias => ["$hostname"],
> >       name => ["$fqdn"],
> >         }
> >   host { "localhost":
> >        ensure => present,
> >       ip => "127.0.0.1",
> >       name => ["localhost"],
> >       alias => ["localhost.localdomain"],
> >         }
> > }
> >
> > What do I need to add my class to delete all lines of every server and
> > add ONLY this two hosts above?
> >
> > regards,
> > Israel.
> > On Sep 2, 2:48 am, Avi Miller <avi.mil...@gmail.com> wrote:
> > > On 02/09/2009, at 5:43 PM, David Schmitt wrote:
> >
> > > >>                alias  => ["$fqdn", "$hostname"]
> >
> > > > yes, but you have to "include host" somewhere in the node.
> >
> > > Also, don't put the $fqdn into the alias field. It is automatically
> > > added by the host provider. You just need the $hostname.
> >
> > > cYa,
> > > Avi
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@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