Hello all. I know there were many discussions about how to remove hosts from puppet. I know the script that removes all entries from the database. What I am looking for is a solution that sets all exported resources to "ensure => absent". Assumed that they have a "ansure" parameter. Anyway, I thought that the resources-type would be something that could help, but I really don''t get its use. I thought about something like: node dead-host { resources{"*": ensure => "absent", } } So, when dead-host runs puppet, all its resources will be set "absent". This does not work and additionally it does not cover the case where dead-host dies before having the chance to run for a last time (with the above snipplet) To resolve the issue above, one would need the possibility to ''fake'' the dead-host from another puppet-host. I have seen that puppetd has the "--fqdn" option, which seems to fake the hostname. Could I use this option on "alive-host" to do: "puppetd --fqdn dead-host.domain.com -vt"? Would this result in "alive-host" being treated as "dead-host"? If this would work, I could create a node definition with all "anti"-classes and could deconfigure all hosts that no longer exist. And the last question: How do you all handle the case when hosts die. Do you simply remove all storedconfigs and do not care about exported resources that might have been imported by other hosts (ssh-keys, mounts, nagios-checks, ...)? Or do you go to all those hosts and remove the resources by hand? Thanks, udo. -- ---[ Institute of Cognitive Science @ University of Osnabrueck ---[ Albrechtstrasse 28, D-49076 Osnabrueck, 969-3362 ---[ Documentation: https://doc.ikw.uni-osnabrueck.de -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=.
Christian Hofstaedtler
2009-Nov-22 11:42 UTC
[Puppet Users] Re: properly removing dead hosts.
On Nov 21, 2:43 pm, Udo Waechter <udo.waech...@uni-osnabrueck.de> wrote:> Hello all. > > I know there were many discussions about how to remove hosts from puppet. I know the script that removes all entries from the database. > > What I am looking for is a solution that sets all exported resources to "ensure => absent". Assumed that they have a "ansure" parameter. >[...]> > And the last question: > How do you all handle the case when hosts die. Do you simply remove all storedconfigs and do not care about exported resources that might have been imported by other hosts (ssh-keys, mounts, nagios-checks, ...)? Or do you go to all those hosts and remove the resources by hand?We have these stanzas in the manifest for the nagios server: 48 resources { "nagios_service": 49 purge => true 50 } 51 resources { "nagios_host": 52 purge => true 53 } 54 resources { "nagios_hostgroup": 55 purge => true 56 } For other resources we''re using similar stanzas, and for file-snippet exported resources we just automatically purge the containing directory. This combined with cleaning the host from the storedconfigs DB gets rid of all the traces left. Christian -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=.
Christian Hofstaedtler wrote:> We have these stanzas in the manifest for the nagios server: > > 48 resources { "nagios_service": > 49 purge => true > 50 } > 51 resources { "nagios_host": > 52 purge => true > 53 } > 54 resources { "nagios_hostgroup": > 55 purge => true > 56 }Are you aware that you also could write resources { [ "nagios_service", "nagios_host", "nagios_hostgroup" ]: purge => true } ? Regards, DavidS -- 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+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=.