Hi, I''m looking for a simple way to check if a file on a client (where puppetd is running) is managed by puppet. At this time, I have to put a comment on the file and have to run a puppetd -to --noop in order to see if puppet triggers actions on this file. Is there any way to simply find if a file on the client is supervised by puppet ? Regards, Carl Chenet -- 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.
R.I.Pienaar
2011-Nov-15 16:04 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
----- Original Message -----> Hi, > > I''m looking for a simple way to check if a file on a client (where > puppetd is running) is managed by puppet. At this time, I have to put > a comment on the file and have to run a puppetd -to --noop in order > to > see if puppet triggers actions on this file. Is there any way to > simply find if a file on the client is supervised by puppet ?I wrote https://github.com/ripienaar/puppet-parselocalconfig some time ago that can do this on the node - I am not sure if it still works with latest puppet version but worth a try -- 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.
DEGREMONT Aurelien
2011-Nov-15 16:08 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
R.I.Pienaar a écrit :> I wrote https://github.com/ripienaar/puppet-parselocalconfig some time > ago that can do this on the node - I am not sure if it still works with > latest puppet version but worth a try > >We are using a modified version of this script and it is mandatory for us. I do not know how to work with Puppet if you do not have an easy way to know which resources are managed by puppet or not. The only other solution if to do some kind of ''grep -r "my_object" /etc/puppet/* '' which is very unfriendly for admins... Aurélien -- 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.
On Tue, Nov 15, 2011 at 5:38 AM, chaica <lordchaica@free.fr> wrote:> I''m looking for a simple way to check if a file on a client (where > puppetd is running) is managed by puppet. At this time, I have to put > a comment on the file and have to run a puppetd -to --noop in order to > see if puppet triggers actions on this file. Is there any way to > simply find if a file on the client is supervised by puppet ?In Puppet 2.7 you can issue the command: puppet catalog select $hostname $type So say if you had a system called prod_db and you are interested in all the file resources puppet manage: puppet catalog select prod_db file To list all the services managed by puppet on that system: puppet catalog select prod_db service This currently only shows the resource title so it can be improved. This is one of the improvements with Puppet 2.7 faces where the catalog information is better exposed to the end user. Thanks, Nan -- 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-Nov-15 16:22 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
On Tue, Nov 15, 2011 at 8:14 AM, Nan Liu <nan@puppetlabs.com> wrote:> On Tue, Nov 15, 2011 at 5:38 AM, chaica <lordchaica@free.fr> wrote: >> I''m looking for a simple way to check if a file on a client (where >> puppetd is running) is managed by puppet. At this time, I have to put >> a comment on the file and have to run a puppetd -to --noop in order to >> see if puppet triggers actions on this file. Is there any way to >> simply find if a file on the client is supervised by puppet ? > > In Puppet 2.7 you can issue the command: > puppet catalog select $hostname $typeAlso as of 2.7.6, we automatically dump this info in a text file on the agents. cat $(puppet agent --configprint resourcefile) file[/etc/puppetlabs/mcollective/ssl/mcollective-private.pem] file[/opt/puppet/libexec/mcollective/mcollective/agent/package.rb] file[/etc/puppetlabs/activemq/broker.p12] file[/etc/puppetlabs/activemq/broker.ts] file[/etc/puppetlabs/mcollective/ssl/mcollective-cert.pem] file[/opt/puppet/share/puppet-dashboard/.ssh/authorized_keys] file[/var/lib/peadmin/.mcollective.d/peadmin-private.pem] file[/opt/puppet/libexec/mcollective/mcollective/registration/meta.rb] file[/opt/puppet/libexec/mcollective/mcollective/util] file[/etc/puppetlabs/mcollective/ssl/clients/mcollective-public.pem] group[peadmin] user[peadmin] ... -- 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.
Vince Taluskie
2011-Nov-15 16:25 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
I''m using the puppet-ls script for this purpose. https://github.com/deanwilson/puppet-scripts/blob/master/puppet-ls vince On Tue, Nov 15, 2011 at 9:22 AM, Nigel Kersten <nigel@puppetlabs.com> wrote:> On Tue, Nov 15, 2011 at 8:14 AM, Nan Liu <nan@puppetlabs.com> wrote: >> On Tue, Nov 15, 2011 at 5:38 AM, chaica <lordchaica@free.fr> wrote: >>> I''m looking for a simple way to check if a file on a client (where >>> puppetd is running) is managed by puppet. At this time, I have to put >>> a comment on the file and have to run a puppetd -to --noop in order to >>> see if puppet triggers actions on this file. Is there any way to >>> simply find if a file on the client is supervised by puppet ? >> >> In Puppet 2.7 you can issue the command: >> puppet catalog select $hostname $type > > Also as of 2.7.6, we automatically dump this info in a text file on the agents. > > cat $(puppet agent --configprint resourcefile) > > file[/etc/puppetlabs/mcollective/ssl/mcollective-private.pem] > file[/opt/puppet/libexec/mcollective/mcollective/agent/package.rb] > file[/etc/puppetlabs/activemq/broker.p12] > file[/etc/puppetlabs/activemq/broker.ts] > file[/etc/puppetlabs/mcollective/ssl/mcollective-cert.pem] > file[/opt/puppet/share/puppet-dashboard/.ssh/authorized_keys] > file[/var/lib/peadmin/.mcollective.d/peadmin-private.pem] > file[/opt/puppet/libexec/mcollective/mcollective/registration/meta.rb] > file[/opt/puppet/libexec/mcollective/mcollective/util] > file[/etc/puppetlabs/mcollective/ssl/clients/mcollective-public.pem] > group[peadmin] > user[peadmin] > ... > > -- > 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. > >-- 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.
Ken Barber
2011-Nov-15 17:03 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
Depends on why you want this info ... but its available in the catalog on the box for ''grepping'' (more or less). Something I recommend to some people: http://www.tenshu.net/2010/08/adventures-in-puppet-tangled-strings.html Which does more or less that ... but shows a banner in VIM for users to warn them the file is puppet managed before they modify it. ken. On Tue, Nov 15, 2011 at 10:38 AM, chaica <lordchaica@free.fr> wrote:> Hi, > > I''m looking for a simple way to check if a file on a client (where > puppetd is running) is managed by puppet. At this time, I have to put > a comment on the file and have to run a puppetd -to --noop in order to > see if puppet triggers actions on this file. Is there any way to > simply find if a file on the client is supervised by puppet ? > > Regards, > Carl Chenet > > -- > 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. > >-- 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.
Iain Sutton
2011-Nov-15 23:39 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
+1 for tangled strings On 16 November 2011 04:03, Ken Barber <ken@puppetlabs.com> wrote:> Depends on why you want this info ... but its available in the catalog > on the box for ''grepping'' (more or less). > > Something I recommend to some people: > > http://www.tenshu.net/2010/08/adventures-in-puppet-tangled-strings.html > > Which does more or less that ... but shows a banner in VIM for users > to warn them the file is puppet managed before they modify it. > > ken. > > On Tue, Nov 15, 2011 at 10:38 AM, chaica <lordchaica@free.fr> wrote: > > Hi, > > > > I''m looking for a simple way to check if a file on a client (where > > puppetd is running) is managed by puppet. At this time, I have to put > > a comment on the file and have to run a puppetd -to --noop in order to > > see if puppet triggers actions on this file. Is there any way to > > simply find if a file on the client is supervised by puppet ? > > > > Regards, > > Carl Chenet > > > > -- > > 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. > > > > > > -- > 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. > >-- 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.
Daniel Maher
2011-Nov-16 09:53 UTC
Re: [Puppet Users] Knowing if a file is managed by puppet
On 11/16/2011 12:39 AM, Iain Sutton wrote:> +1 for tangled strings > > On 16 November 2011 04:03, Ken Barber <ken@puppetlabs.com > <mailto:ken@puppetlabs.com>> wrote: > > Depends on why you want this info ... but its available in the catalog > on the box for ''grepping'' (more or less). > > Something I recommend to some people: > > http://www.tenshu.net/2010/08/adventures-in-puppet-tangled-strings.html > > Which does more or less that ... but shows a banner in VIM for users > to warn them the file is puppet managed before they modify it.A mild word of warning: tangledstrings is distributed as a Vimball, which works well in (most? all?) Linux flavours of Vim, but you may run into support problems in other OS''s (such as OpenBSD, *grumble grumble*). That said, tangledstrings does exactly what it''s supposed to do: act as a very handy warning layer. -- Daniel Maher With listening comes wisdom, with speaking repentance. -- 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.