Hello, I would like to try out augeas with puppet on redhat 5 machines, but I am blocked by the following problem: [root@kissrv20 ~]# puppetd -t info: Retrieving plugins notice: /File[/var/lib/puppet/lib]/checksum: checksum changed ''{mtime}Tue Jul 29 15:30:45 +0200 2008'' to ''{mtime}Tue Sep 02 12:08:22 +0200 2008'' notice: /File[/var/lib/puppet/lib/puppet/type/augeas.rb]/ensure: created info: Retrieving facts err: Could not retrieve catalog: The type ''augeas'' requires the augeas-ruby bindings to be installed at /etc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:6 on node kissrv20.epfl.ch warning: Not using cache on failed catalog I installed the RPMs from [1] and took the puppet type from [2]: [root@kissrv20 ~]# rpm -qa augeas* ruby-augeas ruby-augeas-0.1.0-1.el5 augeas-0.3.0-1.el5 augeas-libs-0.3.0-1.el5 Ruby bindings seem to load as expected: [root@kissrv20 ~]# ruby require ''augeas'' [root@kissrv20 ~]# echo $? 0 I noticed the RPMs weren''t putting their files in the same location than other packages: [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.so'' /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/_augeas.so /usr/lib64/libruby.so.1.8 /usr/lib64/libruby.so.1.8.5 /usr/lib64/ruby/1.8/x86_64-linux/bigdecimal.so /usr/lib64/ruby/1.8/x86_64-linux/curses.so /usr/lib64/ruby/1.8/x86_64-linux/digest.so [...] [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.rb'' /usr/lib/ruby/site_ruby/1.8/ /usr/lib/ruby/1.8/English.rb /usr/lib/ruby/1.8/Env.rb /usr/lib/ruby/1.8/abbrev.rb [...] I tried symlinking _augeas.so into /usr/lib64/ruby/1.8/x86_64-linux/ as well as augeas.rb into /usr/lib/ruby/1.8/ but this doesn''t help. Sorry for cross-posting, but I''m not sure at which level my problem lies. I suspect something related to the path to ruby libs but being quite new to ruby I don''t know in which direction to search. Thanks for any pointers ! Marc [1] http://people.redhat.com/dlutter/yum/rhel/5/ [2] http://git.et.redhat.com/?p=ace.git;a=tree;f=modules/augeas
Marc Fournier wrote:> Hello, > > I would like to try out augeas with puppet on redhat 5 machines, but I > am blocked by the following problem: > > [root@kissrv20 ~]# puppetd -t > info: Retrieving plugins > notice: /File[/var/lib/puppet/lib]/checksum: checksum changed > ''{mtime}Tue Jul 29 15:30:45 +0200 2008'' to ''{mtime}Tue Sep 02 12:08:22 > +0200 2008'' > notice: /File[/var/lib/puppet/lib/puppet/type/augeas.rb]/ensure: created > info: Retrieving facts > err: Could not retrieve catalog: The type ''augeas'' requires the > augeas-ruby bindings to be installed > at /etc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:6 > on node kissrv20.epfl.ch > warning: Not using cache on failed catalogWhere is the puppet master running? Could you possibly need the ruby-augeas bindings on both the puppetmaster server and the client?> > I installed the RPMs from [1] and took the puppet type from [2]: > [root@kissrv20 ~]# rpm -qa augeas* ruby-augeas > ruby-augeas-0.1.0-1.el5 > augeas-0.3.0-1.el5 > augeas-libs-0.3.0-1.el5 > > Ruby bindings seem to load as expected: > [root@kissrv20 ~]# ruby > require ''augeas'' > [root@kissrv20 ~]# echo $? > 0 > > I noticed the RPMs weren''t putting their files in the same location > than other packages: > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.so'' > /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/_augeas.so > /usr/lib64/libruby.so.1.8 > /usr/lib64/libruby.so.1.8.5 > /usr/lib64/ruby/1.8/x86_64-linux/bigdecimal.so > /usr/lib64/ruby/1.8/x86_64-linux/curses.so > /usr/lib64/ruby/1.8/x86_64-linux/digest.so > [...] > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.rb'' > /usr/lib/ruby/site_ruby/1.8/ > /usr/lib/ruby/1.8/English.rb > /usr/lib/ruby/1.8/Env.rb > /usr/lib/ruby/1.8/abbrev.rb > [...]Since the ruby-binding are not core ruby, I belive this is correct. -- bk
Devdas Bhagat
2008-Sep-02 13:50 UTC
[Puppet Users] Re: trouble getting augeas to work with puppet
On Tue, Sep 02, 2008 at 02:57:56PM +0200, Marc Fournier wrote:> > I noticed the RPMs weren''t putting their files in the same location > than other packages: > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.so'' > /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/_augeas.so > /usr/lib64/libruby.so.1.8 > /usr/lib64/libruby.so.1.8.5 > /usr/lib64/ruby/1.8/x86_64-linux/bigdecimal.so > /usr/lib64/ruby/1.8/x86_64-linux/curses.so > /usr/lib64/ruby/1.8/x86_64-linux/digest.so > [...] > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.rb'' > /usr/lib/ruby/site_ruby/1.8/ > /usr/lib/ruby/1.8/English.rb > /usr/lib/ruby/1.8/Env.rb > /usr/lib/ruby/1.8/abbrev.rb > [...] >Your augeas RPM is linked against a 32 bit Ruby, whereas your Ruby is 64 bit. yum -y install ruby-augeas.x86_64 would help, or you would need to rebuild from the SRPM. Devdas Bhagat --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Lutterkort
2008-Sep-03 00:54 UTC
[Puppet Users] Re: trouble getting augeas to work with puppet
On Tue, 2008-09-02 at 14:57 +0200, Marc Fournier wrote:> [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.so'' > /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/_augeas.so > /usr/lib64/libruby.so.1.8 > /usr/lib64/libruby.so.1.8.5 > /usr/lib64/ruby/1.8/x86_64-linux/bigdecimal.so > /usr/lib64/ruby/1.8/x86_64-linux/curses.so > /usr/lib64/ruby/1.8/x86_64-linux/digest.so > [...]That should be ok, and you can check by running "ruby -e ''puts $:''" - the result should include /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/> [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.rb'' > /usr/lib/ruby/site_ruby/1.8/ > /usr/lib/ruby/1.8/English.rb > /usr/lib/ruby/1.8/Env.rb > /usr/lib/ruby/1.8/abbrev.rb > [...]That should contain a ''/usr/lib/ruby/site_ruby/1.8/augeas.rb''> I tried symlinking _augeas.so into /usr/lib64/ruby/1.8/x86_64-linux/ as > well as augeas.rb into /usr/lib/ruby/1.8/ but this doesn''t help.That should not be necessary, the directories that ruby-augeas installs its files into should all be on Ruby''s default search path. David --~--~---------~--~----~------------~-------~--~----~ 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, 02 Sep 2008 09:18:02 -0400 Bryan Kearney <bkearney-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:> Marc Fournier wrote: > > Hello, > > > > I would like to try out augeas with puppet on redhat 5 machines, > > but I am blocked by the following problem: > > > > [root@kissrv20 ~]# puppetd -t > > info: Retrieving plugins > > notice: /File[/var/lib/puppet/lib]/checksum: checksum changed > > ''{mtime}Tue Jul 29 15:30:45 +0200 2008'' to ''{mtime}Tue Sep 02 > > 12:08:22 +0200 2008'' > > notice: /File[/var/lib/puppet/lib/puppet/type/augeas.rb]/ensure: > > created info: Retrieving facts > > err: Could not retrieve catalog: The type ''augeas'' requires the > > augeas-ruby bindings to be installed > > at /etc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:6 > > on node kissrv20.epfl.ch > > warning: Not using cache on failed catalog > > Where is the puppet master running? Could you possibly need the > ruby-augeas bindings on both the puppetmaster server and the client?Yes you are right, this solved the problem ! I''m not sure to understand why, but that''s another point... Thanks a lot !> > I noticed the RPMs weren''t putting their files in the same location > > than other packages: > > > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.so'' > > /usr/lib64/ruby/site_ruby/1.8/x86_64-linux/_augeas.so > > /usr/lib64/libruby.so.1.8 > > /usr/lib64/libruby.so.1.8.5 > > /usr/lib64/ruby/1.8/x86_64-linux/bigdecimal.so > > /usr/lib64/ruby/1.8/x86_64-linux/curses.so > > /usr/lib64/ruby/1.8/x86_64-linux/digest.so > > [...] > > > > [root@kissrv20 ~]# rpm -ql ruby-augeas ruby-libs | grep ''\.rb'' > > /usr/lib/ruby/site_ruby/1.8/ > > /usr/lib/ruby/1.8/English.rb > > /usr/lib/ruby/1.8/Env.rb > > /usr/lib/ruby/1.8/abbrev.rb > > [...] > > Since the ruby-binding are not core ruby, I belive this is correct.Yes I confirm it is. No symlinks are finally needed, neither are any ia32 packages. Only augeas installed on the puppetmaster as well as on the client. Thanks ! Marc
Marc Fournier wrote:> On Tue, 02 Sep 2008 09:18:02 -0400 > Bryan Kearney <bkearney-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote: > >> Marc Fournier wrote: >>> Hello, >>> >>> I would like to try out augeas with puppet on redhat 5 machines, >>> but I am blocked by the following problem: >>> >>> [root@kissrv20 ~]# puppetd -t >>> info: Retrieving plugins >>> notice: /File[/var/lib/puppet/lib]/checksum: checksum changed >>> ''{mtime}Tue Jul 29 15:30:45 +0200 2008'' to ''{mtime}Tue Sep 02 >>> 12:08:22 +0200 2008'' >>> notice: /File[/var/lib/puppet/lib/puppet/type/augeas.rb]/ensure: >>> created info: Retrieving facts >>> err: Could not retrieve catalog: The type ''augeas'' requires the >>> augeas-ruby bindings to be installed >>> at /etc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:6 >>> on node kissrv20.epfl.ch >>> warning: Not using cache on failed catalog >> Where is the puppet master running? Could you possibly need the >> ruby-augeas bindings on both the puppetmaster server and the client? > > Yes you are right, this solved the problem ! I''m not sure to > understand why, but that''s another point... > > Thanks a lot !It must load the module and parse the plugin on the server before sending it down to the client. Puppet Folks.. is that the expected beahiour? -- bk
Marc Fournier
2008-Sep-03 17:36 UTC
[Puppet Users] more trouble/feedback with augeas & puppet
> >> Where is the puppet master running? Could you possibly need the > >> ruby-augeas bindings on both the puppetmaster server and the > >> client? > > > > Yes you are right, this solved the problem !Thanks for your help Bryan ! Now I''ve been able to test this useful type of yours, I came across the following error: err: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]: Failed to retrieve current state of resource: Error sending command ''get'' with params []/undefined method `!='' for "2":String at /home/marc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:7 which was caused by the following statement: augeas{"ssh test": context => "/files/etc/ssh/sshd_config", changes => "set Protocol 2", onlyif => "get Protocol != 2", } I tracked down the problem to the process_get() method in augeas.rb (the puppet type, not the ruby binding). One apparently isn''t allowed to use != on strings with ruby ? marc@lonquimay:~$ ruby print ''toto''.send(''=='', ''toto'') true marc@lonquimay:~$ ruby print ''toto''.send(''<'', ''toto'') false marc@lonquimay:~$ ruby print ''toto''.send(''!='', ''toto'') -:1:in `send'': undefined method `!='' for "toto":String (NoMethodError) from -:1 I could have posted this in a bugtracker, but which one would it belong to ? By the way, as I discovered this handy send() method during my investigation, I imagined it could be useful to be able to do something like this: onlyif => "get param =~ /^regexp$/", Would it be complicated to implement ? Thanks ! Marc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney
2008-Sep-03 17:51 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
Marc Fournier wrote:>>>> Where is the puppet master running? Could you possibly need the >>>> ruby-augeas bindings on both the puppetmaster server and the >>>> client? >>> Yes you are right, this solved the problem ! > > Thanks for your help Bryan ! Now I''ve been able to test this useful > type of yours, I came across the following error: > > err: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]: Failed to > retrieve current state of resource: Error sending command ''get'' with > params []/undefined method `!='' for "2":String > at /home/marc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:7 > > which was caused by the following statement: > > augeas{"ssh test": > context => "/files/etc/ssh/sshd_config", > changes => "set Protocol 2", > onlyif => "get Protocol != 2", > }Do you need to do that check. The result of this statement is the same: augeas{"ssh test": context => "/files/etc/ssh/sshd_config", changes => "set Protocol 2", } Protocol is set to 2. Adding the only-if is really performance item which David has said he would be willing to look at in augeas proper. Or was there an item where you were checking against another part of the tree? I will look to add the != to the syntax.> > I tracked down the problem to the process_get() method in augeas.rb > (the puppet type, not the ruby binding). One apparently isn''t > allowed to use != on strings with ruby ? > > marc@lonquimay:~$ ruby > print ''toto''.send(''=='', ''toto'') > true > marc@lonquimay:~$ ruby > print ''toto''.send(''<'', ''toto'') > false > marc@lonquimay:~$ ruby > print ''toto''.send(''!='', ''toto'') > > -:1:in `send'': undefined method `!='' for "toto":String (NoMethodError) > from -:1 > > I could have posted this in a bugtracker, but which one would it > belong to ? > > > By the way, as I discovered this handy send() method during my > investigation, I imagined it could be useful to be able to do something > like this: > > onlyif => "get param =~ /^regexp$/", > > Would it be complicated to implement ? >I will look to add regex too. -- bk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney
2008-Sep-03 19:28 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
Bryan Kearney wrote:> Marc Fournier wrote: >>>>> Where is the puppet master running? Could you possibly need the >>>>> ruby-augeas bindings on both the puppetmaster server and the >>>>> client? >>>> Yes you are right, this solved the problem ! >> Thanks for your help Bryan ! Now I''ve been able to test this useful >> type of yours, I came across the following error: >> >> err: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]: Failed to >> retrieve current state of resource: Error sending command ''get'' with >> params []/undefined method `!='' for "2":String >> at /home/marc/puppetmaster/modules/augeas/manifests/classes/augeas-test.pp:7 >> >> which was caused by the following statement: >> >> augeas{"ssh test": >> context => "/files/etc/ssh/sshd_config", >> changes => "set Protocol 2", >> onlyif => "get Protocol != 2", >> } > > Do you need to do that check. The result of this statement is the same: > > augeas{"ssh test": > context => "/files/etc/ssh/sshd_config", > changes => "set Protocol 2", > } > > Protocol is set to 2. Adding the only-if is really performance item > which David has said he would be willing to look at in augeas proper. Or > was there an item where you were checking against another part of the > tree? I will look to add the != to the syntax. > > >> I tracked down the problem to the process_get() method in augeas.rb >> (the puppet type, not the ruby binding). One apparently isn''t >> allowed to use != on strings with ruby ? >> >> marc@lonquimay:~$ ruby >> print ''toto''.send(''=='', ''toto'') >> true >> marc@lonquimay:~$ ruby >> print ''toto''.send(''<'', ''toto'') >> false >> marc@lonquimay:~$ ruby >> print ''toto''.send(''!='', ''toto'') >> >> -:1:in `send'': undefined method `!='' for "toto":String (NoMethodError) >> from -:1 >> >> I could have posted this in a bugtracker, but which one would it >> belong to ? >> >> >> By the way, as I discovered this handy send() method during my >> investigation, I imagined it could be useful to be able to do something >> like this: >> >> onlyif => "get param =~ /^regexp$/", >> >> Would it be complicated to implement ? >> > > I will look to add regex too.Pull down the latest [1] and give it a whirl. -- bk [1] http://git.et.redhat.com/?p=ace.git;a=tree;f=modules/augeas --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Marc Fournier
2008-Sep-05 10:07 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
Hello Bryan, Thank you for your reply and your patch ! The "!=" operator now works perfectly :-)>> augeas{"ssh test": >> context => "/files/etc/ssh/sshd_config", >> changes => "set Protocol 2", >> onlyif => "get Protocol != 2", >> } > > Do you need to do that check. The result of this statement is the same: > > augeas{"ssh test": > context => "/files/etc/ssh/sshd_config", > changes => "set Protocol 2", > } > > Protocol is set to 2. Adding the only-if is really performance item > which David has said he would be willing to look at in augeas proper. Or > was there an item where you were checking against another part of the > tree? I will look to add the != to the syntax.The root of my problem was indeed to avoid having augeas update the value if it was already set to what it was supposed to be. The idea behind this was to avoid triggering notices in puppet at each run: notice: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]/returns: executed successfully This is "noise" when reporting is used with puppet, and renders it less useful. Meanwhile, people can use "onlyif" statements as I did. But I think this will have to be corrected. Unfortunatly my knowledge of ruby and puppet is currently not good enough to send you a patch as fast as you did...>> By the way, as I discovered this handy send() method during my >> investigation, I imagined it could be useful to be able to do something >> like this: >> >> onlyif => "get param =~ /^regexp$/", >> >> Would it be complicated to implement ? >> > > I will look to add regex too.Thanks for this too, it work exactly as expected ! Marc --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Lutterkort
2008-Sep-05 19:00 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
On Fri, 2008-09-05 at 12:07 +0200, Marc Fournier wrote:> The root of my problem was indeed to avoid having augeas update the value > if it was already set to what it was supposed to be. The idea behind this > was to avoid triggering notices in puppet at each run: > > notice: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]/returns: > executed successfully > > This is "noise" when reporting is used with puppet, and renders it less useful. > > Meanwhile, people can use "onlyif" statements as I did. But I think this > will have to be corrected. > > Unfortunatly my knowledge of ruby and puppet is currently not good enough > to send you a patch as fast as you did...Yeah, Augeas should be able to tell the caller whether changes were made or not, so that the plugin can suppress spurious reports. This could be done in a number of ways: 1. Indicated through the return value of individual calls like aug_set, aug_insert etc. 2. Through the return value of aug_save 3. Through some metadata entries underneath /augeas Bryan, what would be the easiest for you to integrate into the plugin ? Actually, option (1) won''t really help you in the scenario of ''rm /path; set /path value'' since it will always look like a change, even if there is none in the end. So either having aug_save return whether a file has changed (or maybe the number of files changed) or putting an entry into /augeas/files/$PATH/saved or similar will be the only realistic options. David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney
2008-Sep-08 14:49 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
David Lutterkort wrote:> On Fri, 2008-09-05 at 12:07 +0200, Marc Fournier wrote: >> The root of my problem was indeed to avoid having augeas update the value >> if it was already set to what it was supposed to be. The idea behind this >> was to avoid triggering notices in puppet at each run: >> >> notice: //Node[kissrv20.epfl.ch]/augeas::test/Augeas[ssh test]/returns: >> executed successfully >> >> This is "noise" when reporting is used with puppet, and renders it less useful. >> >> Meanwhile, people can use "onlyif" statements as I did. But I think this >> will have to be corrected. >> >> Unfortunatly my knowledge of ruby and puppet is currently not good enough >> to send you a patch as fast as you did... > > Yeah, Augeas should be able to tell the caller whether changes were made > or not, so that the plugin can suppress spurious reports. This could be > done in a number of ways: > > 1. Indicated through the return value of individual calls like > aug_set, aug_insert etc. > 2. Through the return value of aug_save > 3. Through some metadata entries underneath /augeas > > Bryan, what would be the easiest for you to integrate into the plugin ? > Actually, option (1) won''t really help you in the scenario of ''rm /path; > set /path value'' since it will always look like a change, even if there > is none in the end.I almost need a "dry run" model. Currently, puppet seems to follow a model for each property of "Get the current value, if different, execute the code to sync it up". So, (I think) I would need to be able to execute the code to see if I need to execute it :(> > So either having aug_save return whether a file has changed (or maybe > the number of files changed) or putting an entry > into /augeas/files/$PATH/saved or similar will be the only realistic > options. > > David > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Lutterkort
2008-Sep-08 17:43 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
On Mon, 2008-09-08 at 10:49 -0400, Bryan Kearney wrote:> David Lutterkort wrote: > > > > Yeah, Augeas should be able to tell the caller whether changes were made > > or not, so that the plugin can suppress spurious reports. This could be > > done in a number of ways: > > > > 1. Indicated through the return value of individual calls like > > aug_set, aug_insert etc. > > 2. Through the return value of aug_save > > 3. Through some metadata entries underneath /augeas > > > > Bryan, what would be the easiest for you to integrate into the plugin ? > > Actually, option (1) won''t really help you in the scenario of ''rm /path; > > set /path value'' since it will always look like a change, even if there > > is none in the end. > > I almost need a "dry run" model. Currently, puppet seems to follow a > model for each property of "Get the current value, if different, execute > the code to sync it up". So, (I think) I would need to be able to > execute the code to see if I need to execute it :(True .. unless you want to implement the logic to see if a change to the tree actually changes the underlying file yourself ;) If you want to know at the tree-level if anything changed, you can query that with aug_get beforehand, but that''s not really what the user is interested in. If they give you the commands rm /foo set /foo/bar 1 set /foo/JarJar Binks each of the commands will make a change to the tree, even if the net result is no change to the underlying file. That''s the situation I was wondering about with the 3 options above; you''d really want to report a change only when the underlying file is actually changed. And there''s no way to know that until you actually go to save the file. David --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney
2008-Sep-08 18:35 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
David Lutterkort wrote:> On Mon, 2008-09-08 at 10:49 -0400, Bryan Kearney wrote: >> David Lutterkort wrote: >>> Yeah, Augeas should be able to tell the caller whether changes were made >>> or not, so that the plugin can suppress spurious reports. This could be >>> done in a number of ways: >>> >>> 1. Indicated through the return value of individual calls like >>> aug_set, aug_insert etc. >>> 2. Through the return value of aug_save >>> 3. Through some metadata entries underneath /augeas >>> >>> Bryan, what would be the easiest for you to integrate into the plugin ? >>> Actually, option (1) won''t really help you in the scenario of ''rm /path; >>> set /path value'' since it will always look like a change, even if there >>> is none in the end. >> I almost need a "dry run" model. Currently, puppet seems to follow a >> model for each property of "Get the current value, if different, execute >> the code to sync it up". So, (I think) I would need to be able to >> execute the code to see if I need to execute it :( > > True .. unless you want to implement the logic to see if a change to the > tree actually changes the underlying file yourself ;) > > If you want to know at the tree-level if anything changed, you can query > that with aug_get beforehand, but that''s not really what the user is > interested in. If they give you the commands > > rm /foo > set /foo/bar 1 > set /foo/JarJar Binks > > each of the commands will make a change to the tree, even if the net > result is no change to the underlying file. That''s the situation I was > wondering about with the 3 options above; you''d really want to report a > change only when the underlying file is actually changed. And there''s no > way to know that until you actually go to save the file.I will keep digging, but I think the model now is the "Do you need tochange it, ok change it". I do not think the puppet model supports: " Do you need to change it, Change it, Did you change it?". To fit in into the former, I would need to be able to open up augeas during the "Do you need to change it" step, and then query augeas prior to save to see if it has resulted in a change. So.. I think I would need item 3. -- bk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney wrote:> David Lutterkort wrote: > >> On Mon, 2008-09-08 at 10:49 -0400, Bryan Kearney wrote: >> >>> David Lutterkort wrote: >>> >>>> Yeah, Augeas should be able to tell the caller whether changes were made >>>> or not, so that the plugin can suppress spurious reports. This could be >>>> done in a number of ways: >>>> >>>> 1. Indicated through the return value of individual calls like >>>> aug_set, aug_insert etc. >>>> 2. Through the return value of aug_save >>>> 3. Through some metadata entries underneath /augeas >>>> >>>> Bryan, what would be the easiest for you to integrate into the plugin ? >>>> Actually, option (1) won''t really help you in the scenario of ''rm /path; >>>> set /path value'' since it will always look like a change, even if there >>>> is none in the end. >>>> >>> I almost need a "dry run" model. Currently, puppet seems to follow a >>> model for each property of "Get the current value, if different, execute >>> the code to sync it up". So, (I think) I would need to be able to >>> execute the code to see if I need to execute it :( >>> >> True .. unless you want to implement the logic to see if a change to the >> tree actually changes the underlying file yourself ;) >> >> If you want to know at the tree-level if anything changed, you can query >> that with aug_get beforehand, but that''s not really what the user is >> interested in. If they give you the commands >> >> rm /foo >> set /foo/bar 1 >> set /foo/JarJar Binks >> >> each of the commands will make a change to the tree, even if the net >> result is no change to the underlying file. That''s the situation I was >> wondering about with the 3 options above; you''d really want to report a >> change only when the underlying file is actually changed. And there''s no >> way to know that until you actually go to save the file. >> > > > I will keep digging, but I think the model now is the "Do you need > tochange it, ok change it". I do not think the puppet model supports: " > Do you need to change it, Change it, Did you change it?". To fit in into > the former, I would need to be able to open up augeas during the "Do you > need to change it" step, and then query augeas prior to save to see if > it has resulted in a change. So.. I think I would need item 3. > > -- bk > >I have just started using the augeas module with puppet and i am happy so far but was hit with this issue. Has there been any resolution to this? This example demonstrates this issue well I think; I started with this: augeas { "sshd_HostbasedAuthentication": context => "/files/etc/ssh/sshd_config", changes => [ "set HostbasedAuthentication yes", "set IgnoreUserKnownHosts yes", "set IgnoreRhosts yes" ], require => Package["openssh-server"], notify => Service["sshd"] } I ended up having to do it this way because the sshd was restart each and every run with the previous example: augeas { "sshd_HostbasedAuthentication": context => "/files/etc/ssh/sshd_config", changes => "set HostbasedAuthentication yes", onlyif => "get HostbasedAuthentication != yes", require => Package["openssh-server"], notify => Service["sshd"]; "sshd_IgnoreUserKnownHosts": context => "/files/etc/ssh/sshd_config", changes => "set IgnoreUserKnownHosts yes", onlyif => "get IgnoreUserKnownHosts != yes", require => Package["openssh-server"], notify => Service["sshd"]; "sshd_IgnoreRhosts": context => "/files/etc/ssh/sshd_config", changes => "set IgnoreRhosts yes", onlyif => "get IgnoreRhosts != yes", require => Package["openssh-server"], notify => Service["sshd"]; } Ben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bryan Kearney
2008-Oct-31 15:07 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
Ben wrote:> Bryan Kearney wrote: >> David Lutterkort wrote: >> >>> On Mon, 2008-09-08 at 10:49 -0400, Bryan Kearney wrote: >>> >>>> David Lutterkort wrote: >>>> >>>>> Yeah, Augeas should be able to tell the caller whether changes were made >>>>> or not, so that the plugin can suppress spurious reports. This could be >>>>> done in a number of ways: >>>>> >>>>> 1. Indicated through the return value of individual calls like >>>>> aug_set, aug_insert etc. >>>>> 2. Through the return value of aug_save >>>>> 3. Through some metadata entries underneath /augeas >>>>> >>>>> Bryan, what would be the easiest for you to integrate into the plugin ? >>>>> Actually, option (1) won''t really help you in the scenario of ''rm /path; >>>>> set /path value'' since it will always look like a change, even if there >>>>> is none in the end. >>>>> >>>> I almost need a "dry run" model. Currently, puppet seems to follow a >>>> model for each property of "Get the current value, if different, execute >>>> the code to sync it up". So, (I think) I would need to be able to >>>> execute the code to see if I need to execute it :( >>>> >>> True .. unless you want to implement the logic to see if a change to the >>> tree actually changes the underlying file yourself ;) >>> >>> If you want to know at the tree-level if anything changed, you can query >>> that with aug_get beforehand, but that''s not really what the user is >>> interested in. If they give you the commands >>> >>> rm /foo >>> set /foo/bar 1 >>> set /foo/JarJar Binks >>> >>> each of the commands will make a change to the tree, even if the net >>> result is no change to the underlying file. That''s the situation I was >>> wondering about with the 3 options above; you''d really want to report a >>> change only when the underlying file is actually changed. And there''s no >>> way to know that until you actually go to save the file. >>> >> >> I will keep digging, but I think the model now is the "Do you need >> tochange it, ok change it". I do not think the puppet model supports: " >> Do you need to change it, Change it, Did you change it?". To fit in into >> the former, I would need to be able to open up augeas during the "Do you >> need to change it" step, and then query augeas prior to save to see if >> it has resulted in a change. So.. I think I would need item 3. >> >> -- bk >> >> > I have just started using the augeas module with puppet and i am happy > so far but was hit with this issue. > > Has there been any resolution to this? > > This example demonstrates this issue well I think; > > I started with this: > > augeas { "sshd_HostbasedAuthentication": > context => "/files/etc/ssh/sshd_config", > changes => [ "set HostbasedAuthentication yes", > "set IgnoreUserKnownHosts yes", > "set IgnoreRhosts yes" > ], > require => Package["openssh-server"], > notify => Service["sshd"] > } > > I ended up having to do it this way because the sshd was restart each > and every run with the previous example: > > augeas { "sshd_HostbasedAuthentication": > context => "/files/etc/ssh/sshd_config", > changes => "set HostbasedAuthentication yes", > onlyif => "get HostbasedAuthentication != yes", > require => Package["openssh-server"], > notify => Service["sshd"]; > > "sshd_IgnoreUserKnownHosts": > context => "/files/etc/ssh/sshd_config", > changes => "set IgnoreUserKnownHosts yes", > onlyif => "get IgnoreUserKnownHosts != yes", > require => Package["openssh-server"], > notify => Service["sshd"]; > > "sshd_IgnoreRhosts": > context => "/files/etc/ssh/sshd_config", > changes => "set IgnoreRhosts yes", > onlyif => "get IgnoreRhosts != yes", > require => Package["openssh-server"], > notify => Service["sshd"]; > } > > BenI believe the only way for me to stop this is to actually run the commands once to see if there would be changes, and then run them again at execution time. I am sure that there would be a race condition between the collection and execution stage. James / Luke.. is there a way to communicate to puppet that I actually did not run.. or to disable the notify? -- bk --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Luke Kanies
2008-Nov-12 22:52 UTC
[Puppet Users] Re: more trouble/feedback with augeas & puppet
On Oct 31, 2008, at 8:07 AM, Bryan Kearney wrote:> I believe the only way for me to stop this is to actually run the > commands once to see if there would be changes, and then run them > again > at execution time. I am sure that there would be a race condition > between the collection and execution stage. > > James / Luke.. is there a way to communicate to puppet that I actually > did not run.. or to disable the notify?You''d need your ''insync'' method to indicate that there''s no change to make. There''s no way to have Puppet run the ''sync'' method but have it conclude it didn''t actually do any work, which is what I think you''re actually looking for. You need to query, compare, and only change if necessary. -- Zeilinger''s Fundamental Law: There is no Fundamental Law. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.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 -~----------~----~----~----~------~----~------~--~---