Forrie
2011-Apr-19 18:38 UTC
[Puppet Users] Handling unmanaged resources and their files/configs
We have resources that, from time to time, are selected to be removed (unmanaged). When it comes to ssh keys, fstab... this leaves a lot of stuff behind that we don''t want. Is there a simple way to remove the unmanaged data so we can keep the systems clean. Thanks. -- 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.
Ben Hughes
2011-Apr-20 01:18 UTC
Re: [Puppet Users] Handling unmanaged resources and their files/configs
On Tue, Apr 19, 2011 at 11:38:35AM -0700, Forrie wrote:> Is there a simple way to remove the unmanaged data so we can keep > the systems clean.Setting the resource to ensure => absent will remove them. Or are you after something more? -- Ben Hughes || http://www.puppetlabs.com/ -- 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.
Forrie
2011-Apr-21 18:21 UTC
[Puppet Users] Re: Handling unmanaged resources and their files/configs
That only removes the management element, as I understand. I can think of a couple of scenarios where I''ve had issues with this: * ssh_authorized_keys - there is a bug where if a comment exists it just keeps dumping more copies of the keys. When a key is no longer managed, might be nice to have the option to edit it out. (yes I know you can just do a file://) * NFS mounts. When a mount is no longer managed, I''d like to also remove the mount point under certain conditions. On Apr 19, 9:18 pm, Ben Hughes <b...@puppetlabs.com> wrote:> On Tue, Apr 19, 2011 at 11:38:35AM -0700, Forrie wrote: > > Is there a simple way to remove the unmanaged data so we can keep > > the systems clean. > > Setting the resource to ensure => absent will remove them. Or are you > after something more? > > -- > Ben Hughes ||http://www.puppetlabs.com/-- 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.
Nigel Kersten
2011-Apr-21 18:36 UTC
Re: [Puppet Users] Re: Handling unmanaged resources and their files/configs
On Thu, Apr 21, 2011 at 11:21 AM, Forrie <forrie@gmail.com> wrote:> That only removes the management element, as I understand. > > I can think of a couple of scenarios where I''ve had issues with this: > > * ssh_authorized_keys - there is a bug where if a comment exists it > just keeps dumping more copies of the keys. When a key is no longer > managed, might be nice to have the option to edit it out. (yes I > know you can just do a file://) > > * NFS mounts. When a mount is no longer managed, I''d like to also > remove the mount point under certain conditions.Have you looked at the Resources resource? It will let you purge unmanaged resources of a given type. http://docs.puppetlabs.com/references/latest/type.html resources This is a metatype that can manage other resource types. Any metaparams specified here will be passed on to any generated resources, so you can purge umanaged resources but set noop to true so the purging is only logged and does not actually happen. PARAMETERS NAME The name of the type to be managed. PURGE Purge unmanaged resources. This will delete any resource that is not specified in your configuration and is not required by any specified resources. Valid values are true, false. UNLESS_SYSTEM_USER This keeps system users from being purged. By default, it does not purge users whose UIDs are less than or equal to 500, but you can specify a different UID as the inclusive limit. Valid values are true, false. Values can match /^\d+$/. -- 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.
Forrie
2011-Apr-21 20:24 UTC
[Puppet Users] Re: Handling unmanaged resources and their files/configs
This type seems like it could have unwanted side effects. I''d prefer there be a way to specify the resource I want purged, instead of just all or nothing. On Apr 21, 2:36 pm, Nigel Kersten <ni...@puppetlabs.com> wrote:> On Thu, Apr 21, 2011 at 11:21 AM, Forrie <for...@gmail.com> wrote: > > That only removes the management element, as I understand. > > > I can think of a couple of scenarios where I''ve had issues with this: > > > * ssh_authorized_keys - there is a bug where if a comment exists it > > just keeps dumping more copies of the keys. When a key is no longer > > managed, might be nice to have the option to edit it out. (yes I > > know you can just do a file://) > > > * NFS mounts. When a mount is no longer managed, I''d like to also > > remove the mount point under certain conditions. > > Have you looked at the Resources resource? It will let you purge > unmanaged resources of a given type. > > http://docs.puppetlabs.com/references/latest/type.html > > resources > > This is a metatype that can manage other resource types. Any > metaparams specified here will be passed on to any generated > resources, so you can purge umanaged resources but set noop to true so > the purging is only logged and does not actually happen. > > PARAMETERS > NAME > The name of the type to be managed. > > PURGE > Purge unmanaged resources. This will delete any resource that is not > specified in your configuration and is not required by any specified > resources. Valid values are true, false. > > UNLESS_SYSTEM_USER > This keeps system users from being purged. By default, it does not > purge users whose UIDs are less than or equal to 500, but you can > specify a different UID as the inclusive limit. Valid values are true, > false. Values can match /^\d+$/.-- 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.
Nigel Kersten
2011-Apr-21 20:29 UTC
Re: [Puppet Users] Re: Handling unmanaged resources and their files/configs
On Thu, Apr 21, 2011 at 1:24 PM, Forrie <forrie@gmail.com> wrote:> This type seems like it could have unwanted side effects. I''d prefer > there be a way to specify the resource I want purged, instead of just > all or nothing. >You can do that, but you did ask about handling "unmanaged resources".... :) A resource that you''re explicitly ensuring is absent isn''t an unmanaged resource as it''s being managed. -- 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.
Forrie
2011-Apr-21 21:06 UTC
[Puppet Users] Re: Handling unmanaged resources and their files/configs
Fair enough :-) In my case, we have NFS mounts that rotate out -- and I dread having to manually prune the many systems we use. Puppet will handle /etc/fstab, but I want to remove the mountpoint as well. On Apr 21, 4:29 pm, Nigel Kersten <ni...@puppetlabs.com> wrote:> On Thu, Apr 21, 2011 at 1:24 PM, Forrie <for...@gmail.com> wrote: > > This type seems like it could have unwanted side effects. I''d prefer > > there be a way to specify the resource I want purged, instead of just > > all or nothing. > > You can do that, but you did ask about handling "unmanaged resources".... :) > > A resource that you''re explicitly ensuring is absent isn''t an unmanaged > resource as it''s being managed.-- 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.
jcbollinger
2011-Apr-25 12:54 UTC
[Puppet Users] Re: Handling unmanaged resources and their files/configs
On Apr 21, 4:06 pm, Forrie <for...@gmail.com> wrote:> Fair enough :-) In my case, we have NFS mounts that rotate out -- > and I dread having to manually prune the many systems we use. Puppet > will handle /etc/fstab, but I want to remove the mountpoint as well.As Nigel implied, what you''re asking is self-contradictory. If you want Puppet to clean up a resource, then that constitutes Puppet managing it. Even using the Resources type to purge otherwise unmanaged resources (which makes me nervous, too) puts resources under Puppet management in a logical sense. As I sometimes tell folks, "unmanaged" does not mean absent, it means "I don''t care." If you *do* care, then manage the resource. That seems almost a slam dunk for a resource that starts out managed. Instead of taking it out of management, manage it into the state you want (such as absent). 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.
Felix Frank
2011-Apr-27 14:26 UTC
Re: [Puppet Users] Re: Handling unmanaged resources and their files/configs
On 04/21/2011 11:06 PM, Forrie wrote:> Fair enough :-) In my case, we have NFS mounts that rotate out -- > and I dread having to manually prune the many systems we use. Puppet > will handle /etc/fstab, but I want to remove the mountpoint as well.Then wrap your NFS mounts in a defined type. If ensured it to absent, it can (variably) start managing the mountpoint as absent. HTH, Felix -- 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.