I''m not sure if this has been posted previously, but I couldn''t find any information on it. I added a cron job via the cron type and it installed properly. Next, I removed the cron type from the manifest. The result was that, while the entry was no longer in the yaml file, the cron entry was not removed! Is this a bug, or the way that it is supposed to function? Thank you, -- Rob -- ____________________________________________________________________________________ Don''t get soaked. Take a quick peak at the forecast with the Yahoo! Search weather shortcut. http://tools.search.yahoo.com/shortcuts/#loc_weather _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
To head off the questions: Puppet 0.22.0 on Red Hat AS 4. Thank you, -- Rob -- ----- Original Message ---- From: Robert Mombro <j8irfm@yahoo.com> To: puppet-users@madstop.com Sent: Wednesday, January 17, 2007 3:33:04 PM Subject: [Puppet-users] Cron jobs not removed when deleted from Manifest I''m not sure if this has been posted previously, but I couldn''t find any information on it. I added a cron job via the cron type and it installed properly. Next, I removed the cron type from the manifest. The result was that, while the entry was no longer in the yaml file, the cron entry was not removed! Is this a bug, or the way that it is supposed to function? Thank you, -- Rob -- Looking for earth-friendly autos? Browse Top Cars by "Green Rating" at Yahoo! Autos'' Green Center. _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users ____________________________________________________________________________________ Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Jan 17, 2007, at 12:33 PM, Robert Mombro wrote:> I''m not sure if this has been posted previously, but I couldn''t > find any information on it. > > I added a cron job via the cron type and it installed properly. > Next, I removed the cron type from the manifest. > > The result was that, while the entry was no longer in the yaml > file, the cron entry was not removed! > > Is this a bug, or the way that it is supposed to function?To get this behavior you have to use purging[1]. -Blake 1. http://reductivelabs.com/projects/puppet/documentation/ typedocs.html#meta-parameters
Blake, Thank you for your quick response, it was most helpful. -- Rob -- ----- Original Message ---- From: Blake Barnett <shadoi@nanovoid.com> To: Puppet User Discussion <puppet-users@madstop.com> Sent: Wednesday, January 17, 2007 3:47:06 PM Subject: Re: [Puppet-users] Cron jobs not removed when deleted from Manifest On Jan 17, 2007, at 12:33 PM, Robert Mombro wrote:> I''m not sure if this has been posted previously, but I couldn''t > find any information on it. > > I added a cron job via the cron type and it installed properly. > Next, I removed the cron type from the manifest. > > The result was that, while the entry was no longer in the yaml > file, the cron entry was not removed! > > Is this a bug, or the way that it is supposed to function?To get this behavior you have to use purging[1]. -Blake 1. http://reductivelabs.com/projects/puppet/documentation/ typedocs.html#meta-parameters _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users ____________________________________________________________________________________ Need a quick answer? Get one in minutes from people who know. Ask your question on www.Answers.yahoo.com _______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Jan 18, 2007, at 7:33 AM, Robert Mombro wrote:> I''m not sure if this has been posted previously, but I couldn''t > find any information on it. > > I added a cron job via the cron type and it installed properly. > Next, I removed the cron type from the manifest. > > The result was that, while the entry was no longer in the yaml > file, the cron entry was not removed! > > Is this a bug, or the way that it is supposed to function?By default Puppet always leaves unmanaged resources. Currently Puppet does not know the difference between a resource that just became unmanaged (i.e., you took it out of the manifest) and one that has always been unmanaged. As Blake pointed out, purging is the right solution, but note that this will purge *all* cron jobs, not just those you remove from your manifest. If you want to make sure a cron job is gone, then add ''ensure => absent'' to the cron job definition. -- Think twice before you speak, and then you may be able to say something more insulting than if you spoke right out at once. - Evan Esar --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Christian G. Warden
2007-Jan-18 17:05 UTC
Re: Cron jobs not removed when deleted from Manifest
On Thu, Jan 18, 2007 at 08:02:24PM +1100, Luke Kanies wrote:> On Jan 18, 2007, at 7:33 AM, Robert Mombro wrote: > > > I''m not sure if this has been posted previously, but I couldn''t > > find any information on it. > > > > I added a cron job via the cron type and it installed properly. > > Next, I removed the cron type from the manifest. > > > > The result was that, while the entry was no longer in the yaml > > file, the cron entry was not removed! > > > > Is this a bug, or the way that it is supposed to function? > > By default Puppet always leaves unmanaged resources. Currently > Puppet does not know the difference between a resource that just > became unmanaged (i.e., you took it out of the manifest) and one that > has always been unmanaged. > > As Blake pointed out, purging is the right solution, but note that > this will purge *all* cron jobs, not just those you remove from your > manifest.Does purge apply per-user to cron jobs or to all users? That is, can puppet manage all cron jobs for one user, but allow non-puppet-managed cron jobs for other users? Christian
On Jan 19, 2007, at 4:05 AM, Christian G. Warden wrote:> > Does purge apply per-user to cron jobs or to all users? That is, can > puppet manage all cron jobs for one user, but allow non-puppet-managed > cron jobs for other users?For the record, cron jobs are a complete pain. I''m not exactly proud of the implementation, and while I clearly will fix what bugs I can I will not be surprised to find some weird bugs. Cron jobs are very weird mostly because they are contained in so many different files. That being said, this is how purging works. Generally, purging is always type-wide. You purge all cron jobs, not just individual users'' cron jobs. I hadn''t thought about cron jobs specifically when writing purging, as evidenced by this fact. The "right" solution is (probably) to have some kind of mini-language to support matching which resources should be purged. I''m all ears for recommendations on what this might look like, but I don''t have any specific plans to do it right now. -- If two men agree on everything, you may be sure that one of them is doing the thinking. -- Lyndon B. Johnson --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
When I was messing around with the cron jobs I noticed that you put a "Puppet owns the following" type of comment in the crontab. It would seem that, in the case of files that accept comments, surrounding all Puppet generated blocks with a specific comment string would allow you to later purge the artifacts. I suppose that this could also be abstracted into allowing for classed purges where each block is tagged and you only purge specific ones on a queue basis...or something like that... It may be too time intensive for some situations since you would have to parse each file of each type marked for purging. Just a thought. Thanks, Trevor On 1/18/07, Luke Kanies <luke@madstop.com> wrote:> > On Jan 19, 2007, at 4:05 AM, Christian G. Warden wrote: > > > > Does purge apply per-user to cron jobs or to all users? That is, can > > puppet manage all cron jobs for one user, but allow non-puppet-managed > > cron jobs for other users? > > For the record, cron jobs are a complete pain. I''m not exactly proud > of the implementation, and while I clearly will fix what bugs I can I > will not be surprised to find some weird bugs. Cron jobs are very > weird mostly because they are contained in so many different files. > > That being said, this is how purging works. > > Generally, purging is always type-wide. You purge all cron jobs, not > just individual users'' cron jobs. I hadn''t thought about cron jobs > specifically when writing purging, as evidenced by this fact. > > The "right" solution is (probably) to have some kind of mini-language > to support matching which resources should be purged. I''m all ears > for recommendations on what this might look like, but I don''t have > any specific plans to do it right now. > > -- > If two men agree on everything, you may be sure that one of them is > doing the thinking. -- Lyndon B. Johnson > --------------------------------------------------------------------- > Luke Kanies | http://reductivelabs.com | http://madstop.com > > > _______________________________________________ > Puppet-users mailing list > Puppet-users@madstop.com > https://mail.madstop.com/mailman/listinfo/puppet-users >_______________________________________________ Puppet-users mailing list Puppet-users@madstop.com https://mail.madstop.com/mailman/listinfo/puppet-users
On Jan 19, 2007, at 7:02 AM, Trevor Vaughan wrote:> When I was messing around with the cron jobs I noticed that you put > a "Puppet owns the following" type of comment in the crontab. > > It would seem that, in the case of files that accept comments, > surrounding all Puppet generated blocks with a specific comment > string would allow you to later purge the artifacts.Crontabs are currently the only files (that I know of) in which Puppet generates any comments beyond a header, so this wouldn''t actually be used much, from what I can tell. How were you thinking this would be useful?> I suppose that this could also be abstracted into allowing for > classed purges where each block is tagged and you only purge > specific ones on a queue basis...or something like that... > > It may be too time intensive for some situations since you would > have to parse each file of each type marked for purging.I already have to do that... -- The one thing more difficult than following a regimen is not imposing it on others. -- Marcel Proust --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 22 January 2007 17:45, Luke Kanies wrote:> On Jan 19, 2007, at 7:02 AM, Trevor Vaughan wrote: > > When I was messing around with the cron jobs I noticed that you put > > a "Puppet owns the following" type of comment in the crontab. > > > > It would seem that, in the case of files that accept comments, > > surrounding all Puppet generated blocks with a specific comment > > string would allow you to later purge the artifacts. > > Crontabs are currently the only files (that I know of) in which > Puppet generates any comments beyond a header, so this wouldn''t > actually be used much, from what I can tell. > > How were you thinking this would be useful?This is useful everywhere where you need "append_if_no_such_line", but where one line is not enough. I have written such a thing myself to integrate serveral (collected) filesnippets into a unsupported config file format, which has to be hand edited too. Not really nice :-( Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFtTmc/Pp1N6Uzh0URAvspAJ0QXXMKZzkpMOB3VwM1m538QJHzUACgh4Uf QD5hKAf1WqA8M8Fq9rV+TB0=Yolf -----END PGP SIGNATURE-----
On Jan 22, 2007, at 4:24 PM, David Schmitt wrote:> > This is useful everywhere where you need "append_if_no_such_line", > but where > one line is not enough. I have written such a thing myself to > integrate > serveral (collected) filesnippets into a unsupported config file > format, > which has to be hand edited too. Not really nice :-(Are you talking about when you''re using Ruby to modify files, or using exec statements within Puppet? I could see having an option to enable this kind of bracketing, it couldn''t be the default on all files, since not all files support comments. -- I have a switch in my apartment... It doesn''t do anything. Every once in a while, I turn it on and off. One day I got a call... It was from a woman in France... She said, "Cut it out!" -- Stephen Wright --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 23 January 2007 01:16, Luke Kanies wrote:> On Jan 22, 2007, at 4:24 PM, David Schmitt wrote: > > This is useful everywhere where you need "append_if_no_such_line", > > but where > > one line is not enough. I have written such a thing myself to > > integrate > > serveral (collected) filesnippets into a unsupported config file > > format, > > which has to be hand edited too. Not really nice :-( > > Are you talking about when you''re using Ruby to modify files, or > using exec statements within Puppet?Since I am not very fluent in ruby i have coded it as a perl script which I execute.> I could see having an option to enable this kind of bracketing, it > couldn''t be the default on all files, since not all files support > comments.For maximum configurability, the bracket should be "$comment_char BEGIN $tag"/"$comment_char END $tag". Using the tag, one can manage multiple snippets in one file. Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFthCP/Pp1N6Uzh0URAn75AJ9dgKUOUd5r8k56SYoYc/tdvTujAwCbB6Wy L5eSZAwgLxKLAjQymY0QBd4=ye2Q -----END PGP SIGNATURE-----
On Jan 23, 2007, at 7:41 AM, David Schmitt wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Tuesday 23 January 2007 01:16, Luke Kanies wrote: >> On Jan 22, 2007, at 4:24 PM, David Schmitt wrote: >>> This is useful everywhere where you need "append_if_no_such_line", >>> but where >>> one line is not enough. I have written such a thing myself to >>> integrate >>> serveral (collected) filesnippets into a unsupported config file >>> format, >>> which has to be hand edited too. Not really nice :-( >> >> Are you talking about when you''re using Ruby to modify files, or >> using exec statements within Puppet? > > Since I am not very fluent in ruby i have coded it as a perl script > which I > execute. > >> I could see having an option to enable this kind of bracketing, it >> couldn''t be the default on all files, since not all files support >> comments. > > For maximum configurability, the bracket should be "$comment_char > BEGIN > $tag"/"$comment_char END $tag". Using the tag, one can manage multiple > snippets in one file.I still don''t quite understand what you''re getting at. You''re using perl to make the file changes, but you somehow want Puppet to notice that an external script is modifying a file, and to bracket those modifications automatically? The only way I can see to do this is to direclty support modifications to files, such that perl would use some part of Puppet as a proxy to modify the files. This isn''t going to happen, I expect. -- I''m seventeen and I''m crazy. My uncle says the two always go together. When people ask your age, he said, always say seventeen and insane. -- Ray Bradbury --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wednesday 24 January 2007 18:57, Luke Kanies wrote:> I still don''t quite understand what you''re getting at. You''re using > perl to make the file changes, but you somehow want Puppet to notice > that an external script is modifying a file, and to bracket those > modifications automatically? > > The only way I can see to do this is to direclty support > modifications to files, such that perl would use some part of Puppet > as a proxy to modify the files. This isn''t going to happen, I expect.Sorry, I wasn''t clear enough. I am currently using perl to edit files and I use such brackets to do these edits and i use puppet''s File{checksum} to integrate this with the rest of my manifest. It would be much more sensible though, to have the "bracket editor" in puppet proper. This would replace a crude hand hacked, weakly coupled exec with a properly integrated type. Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD4DBQFFuLyx/Pp1N6Uzh0URAjgdAKCA7AeF4O5YXiEJgB3fPJhw2pYskgCXcDO+ /UTLyCSL1XFnQkjRZ6BfiA==UydX -----END PGP SIGNATURE-----
On Jan 25, 2007, at 8:20 AM, David Schmitt wrote:> > Sorry, I wasn''t clear enough. I am currently using perl to edit > files and I > use such brackets to do these edits and i use puppet''s File > {checksum} to > integrate this with the rest of my manifest. > > It would be much more sensible though, to have the "bracket editor" > in puppet > proper. This would replace a crude hand hacked, weakly coupled exec > with a > properly integrated type.How would you like this to work? I''m interested in doing something like this, and I''ve been experimenting for years on how to best build up configuration files, but I''ve never really come up with anything particularly satisfactory. The current ''parsedfile'' provider base class is pretty good for generating and parsing files, but (of course) it requires ruby, and may not be quite what you''re looking for. I do recommend you check out some of it''s subclasses, though -- anything named ''parsed.rb'' in lib/puppet/provider/*. -- The brain is a wonderful organ. It starts working the moment you get up in the morning and does not stop until you get into the office. --Robert Frost --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 25 January 2007 20:10, Luke Kanies wrote:> On Jan 25, 2007, at 8:20 AM, David Schmitt wrote: > > It would be much more sensible though, to have the "bracket editor" > > in puppet > > proper. This would replace a crude hand hacked, weakly coupled exec > > with a > > properly integrated type. > > How would you like this to work? > > I''m interested in doing something like this, and I''ve been > experimenting for years on how to best build up configuration files, > but I''ve never really come up with anything particularly satisfactory.I have posted a description how I would imagine it to the wiki: http://reductivelabs.com/cgi-bin/puppet.cgi/wiki/BracketEditor> The current ''parsedfile'' provider base class is pretty good for > generating and parsing files, but (of course) it requires ruby, and > may not be quite what you''re looking for. I do recommend you check > out some of it''s subclasses, though -- anything named ''parsed.rb'' in > lib/puppet/provider/*.Yeah, as far as I can see, this is only for everything-on-a-line formats. Perhaps a everything-in-a-paragraph format and perhaps a .ini-style parsedfile might be more efficient due to specialisation. Then one could directly export/collect paragraphs or .ini sections. But that''d need more expressive collect selectors. Regards, David - -- - - hallo... wie gehts heute? - - *hust* gut *rotz* *keuch* - - gott sei dank kommunizieren wir über ein septisches medium ;) -- Matthias Leeb, Uni f. angewandte Kunst, 2005-02-15 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFFul/Q/Pp1N6Uzh0URAqHpAJ9g6JRbv7KAoHhGlg3spGUF3fE/0wCgnFPw j5SD1TxxcW0sCY2DYAXu/zA=Q7M4 -----END PGP SIGNATURE-----
On Jan 26, 2007, at 2:08 PM, David Schmitt wrote:> I have posted a description how I would imagine it to the wiki: > > http://reductivelabs.com/cgi-bin/puppet.cgi/wiki/BracketEditorThis is very similar to what I wanted to do i the very beginning, generating and parsing files. I''ll do my best to go over and it and compare it in detail to what I''ve tried. I''m much more experienced now than when I first tried this 18 months ago, so maybe I could get what we both want. Or maybe you could. :)>> The current ''parsedfile'' provider base class is pretty good for >> generating and parsing files, but (of course) it requires ruby, and >> may not be quite what you''re looking for. I do recommend you check >> out some of it''s subclasses, though -- anything named ''parsed.rb'' in >> lib/puppet/provider/*. > > Yeah, as far as I can see, this is only for everything-on-a-line > formats. > > Perhaps a everything-in-a-paragraph format and perhaps a .ini-style > parsedfile > might be more efficient due to specialisation. Then one could directly > export/collect paragraphs or .ini sections. But that''d need more > expressive > collect selectors.Well, I always figured it was a question of whether you could express the file part in an easily demarkable way. If you look at the parsedfile subclasses, they basically talk about recordseparators and field separators; it doesn''t really matter what those separators are, as long as it''s consistent. Things get a lot harder if you have to use regexes to determine fields, but for simple records it''s pretty easy. -- The remarkable thing about Shakespeare is that he really is very good, in spite of all the people who say he is very good. -- Robert Graves --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com