You're specifically looking for a resource called `resources` with the title `host`, as shown at http://www.puppetcookbook.com/posts/remove-all-unmanaged-host-entries.html. More info at https://docs.puppet.com/puppet/latest/reference/type.html#resources
Rob Nelson [email protected] On Wed, Oct 5, 2016 at 7:56 AM, Aditya Gupta <[email protected]> wrote: > Thanks for the answer. > > I am using standard puppet resource type: > > https://docs.puppet.com/puppet/latest/reference/types/host.html > > and i can not see support of purge parameter in it. > > > On Wednesday, October 5, 2016 at 12:44:38 PM UTC+5:30, Craig Dunn wrote: >> >> >> >> On Wed, Oct 5, 2016 at 12:24 AM, Aditya Gupta <[email protected]> >> wrote: >> >>> Hello All, >>> I am using host resources in my puppet class to manage hosts file of the >>> client. >>> >>> I am facing one issue where if I have already connected client to the >>> puppet server where hosts file have its own entries as well as entries >>> defined by puppet server . >>> >>> But whenever I replaced my hosts file from some other server then in >>> next puppet run my old entries removed from the hosts file and I can only >>> see entries managed by puppet. >>> >>> >>> >> FYI in future this type of question is probably more suited to >> puppet-users than puppet-dev. >> >> It sounds like resource purging, meaning that Puppet will purge any >> resources found that are not under Puppet control. You don't mention if >> you use a Forge module to manage hosts, or something home grown - if you're >> using something like https://forge.puppet.com/ghoneycutt/hosts then >> you'll need to set (or unset) the "purge_hosts" option. Otherwise, you >> might have something like this declared.... >> >> resources { 'hosts': purge => true } >> >> Either way, it should be easy enough to change the behaviour but without >> knowing what module you are using I can't really tell you exactly how. >> >> Craig >> >> -- >> Enviatics | Automation and Configuration Management >> Puppet Labs Service Delivery Partner & Certified Consultant >> http://www.enviatics.com | @Enviatics | [email protected] >> >> -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/puppet-dev/0b57afa6-4d5f-4a62-97fc-6c7f6b5a4bf2%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-dev/0b57afa6-4d5f-4a62-97fc-6c7f6b5a4bf2%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/CAC76iT_7Vct5F_GA73Bqe4zhdM5b%3DvutkgUq3Aji8ZgC%3DHfTmw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
