Larry Ludwig
2011-Jun-06 23:40 UTC
[Puppet Users] How do you handle deleted nodes with exported resources in this situation?
I have an issue where for a file type of an exported resource I must define
as such:
force => false,
replace => false,
Meaning the file is created, but do not replace after it''s added. I do
this
because of the app modifies the config file after (I know bad idea on their
part).
How can I ensure this file is removed when I remove the node from the
storeconfig database?
In general, is there a way to trigger a event puppet when a instance is
removed?
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/puppet-users/-/NmI1RmUwTXY5YndK.
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=en.
jcbollinger
2011-Jun-07 14:10 UTC
[Puppet Users] Re: How do you handle deleted nodes with exported resources in this situation?
On Jun 6, 6:40 pm, Larry Ludwig <larry...@gmail.com> wrote:> I have an issue where for a file type of an exported resource I must define > as such: > > force => false, > replace => false, > > Meaning the file is created, but do not replace after it''s added. I do this > because of the app modifies the config file after (I know bad idea on their > part). > > How can I ensure this file is removed when I remove the node from the > storeconfig database?1) [ugly] You can create a local resource for each such file, with ensure => absent 2) You can manage the files'' directory and all files and subdirectories in it, and use recurse => true, purge => true on the directory Note that both of these cause the file to *remain* absent, though the latter will adapt dynamically if the file in question becomes managed again.> In general, is there a way to trigger a event puppet when a instance is > removed?No. Puppet has no concept of node removal, and the master operates on behalf of a particular node only when that node requests a catalog, which a removed node cannot do. More generally, Puppet has no concept of un-managing anything. John -- 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=en.
Stefan Schulte
2011-Jun-07 16:12 UTC
Re: [Puppet Users] Re: How do you handle deleted nodes with exported resources in this situation?
On Tue, Jun 07, 2011 at 07:10:22AM -0700, jcbollinger wrote:> > > On Jun 6, 6:40 pm, Larry Ludwig <larry...@gmail.com> wrote: > > I have an issue where for a file type of an exported resource I must define > > as such: > > > > force => false, > > replace => false, > > > > Meaning the file is created, but do not replace after it''s added. I do this > > because of the app modifies the config file after (I know bad idea on their > > part). > > > > How can I ensure this file is removed when I remove the node from the > > storeconfig database? >You can download the puppet sources. In the ext Directory you''ll find a script »puppetstoredconfigclean.rb NODE_TO_BE_REMOVED«. AFAIK the script will set the ensure property of all exported resources of the specified host to absent. -Stefan
jcbollinger
2011-Jun-08 15:50 UTC
[Puppet Users] Re: How do you handle deleted nodes with exported resources in this situation?
On Jun 7, 11:12 am, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> On Tue, Jun 07, 2011 at 07:10:22AM -0700, jcbollinger wrote: > > > On Jun 6, 6:40 pm, Larry Ludwig <larry...@gmail.com> wrote: > > > I have an issue where for a file type of an exported resource I must define > > > as such: > > > > force => false, > > > replace => false, > > > > Meaning the file is created, but do not replace after it''s added. I do this > > > because of the app modifies the config file after (I know bad idea on their > > > part). > > > > How can I ensure this file is removed when I remove the node from the > > > storeconfig database? > > You can download the puppet sources. In the ext Directory you''ll find a > script »puppetstoredconfigclean.rb NODE_TO_BE_REMOVED«. AFAIK the script will > set the ensure property of all exported resources of the specified host > to absent.Nice. Do I judge correctly that this is an *alternative* to actually removing the node in question from the storeconfig DB? I mean, otherwise, there are no resources in the DB to flag absent. If you already have removed the node and its resources from the DB, then I can''t imagine that such a script could help. I guess you could actually clean out the DB later, after you''re confident that the revised exported resources have been applied everywhere needed. Note also that conceivably there can be exported resources for which ensure => absent is not the correct cleanup. That may be more theoretical than practical, however. John -- 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=en.
Brian Gallew
2011-Jun-08 16:04 UTC
Re: [Puppet Users] Re: How do you handle deleted nodes with exported resources in this situation?
On Jun 8, 2011, at 8:50 AM, jcbollinger wrote:> > > On Jun 7, 11:12 am, Stefan Schulte <stefan.schu...@taunusstein.net> > wrote: >> You can download the puppet sources. In the ext Directory you''ll find a >> script »puppetstoredconfigclean.rb NODE_TO_BE_REMOVED«. AFAIK the script will >> set the ensure property of all exported resources of the specified host >> to absent. > > > Nice. Do I judge correctly that this is an *alternative* to actually > removing the node in question from the storeconfig DB? I mean, > otherwise, there are no resources in the DB to flag absent. If you > already have removed the node and its resources from the DB, then I > can''t imagine that such a script could help.My experience is that this script actually purges all of the resources, facts, reports, etc. from the storedconfigs repository. -- 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=en.