:-) Hi Ohad, and thanks for your soon answer..
Umm, I did'nt know purge can be used in hosts resource... is purge a
global parameter others resources can use?
So, in my configuration do I have to put 3 purge => true in my 2
entries?
class hosts {
host { "$hostname":
ensure => present,
purge => true,
ip => "$ipaddress",
alias => ["$hostname"],
name => ["$fqdn"],
}
host { "localhost":
ensure => present,
purge => true,
ip => "127.0.0.1",
name => ["localhost"],
alias => ["localhost.localdomain"],
}
}
Or should I have to set a Host: { purge => true} at top level
default.pp file?
regards,
Israel
On Sep 2, 9:26 pm, Ohad Levy <[email protected]> wrote:
> 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 <[email protected]> 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, [email protected] 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 <[email protected]>
>
> > > Date: Wed, 2 Sep 2009 18:42:37
> > > To: Puppet Users<[email protected]>
> > > 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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---