On Mon, Apr 9, 2012 at 2:40 PM, Shantanu <knowshant...@gmail.com> wrote:
> > > On Apr 9, 4:06 pm, Jeff McCune <j...@puppetlabs.com> wrote: > > On Mon, Apr 9, 2012 at 4:45 PM, Shantanu <knowshant...@gmail.com> wrote: > > > > > I am using stdlib module's validate_re function to validate parameters > > > passed to a parameterized class as pasted here: > > >http://pastebin.com/7eYAeLEa > > > . > > > > > The validation works fine however when I run this manifest locally > > > using 'puppet apply' command where puppet execution stops if a > > > validation test fails. However when I use it in client-server model > > > then I do see a validation match failure error but rest of the puppet > > > manifest application (file creation) proceeds fine instead of > > > failing. > > > > validate_re will abort the catalog compilation process entirely. Are you > > sure your puppet agent is not falling back to using a previously cached > > copy of the catalog? > > > > If you use puppet agent --test it will disable the "use cache on failure" > > feature of Puppet. > > > > -Jeff > > > Thanks Jeff. That was the issue. The pastebin logs do indicate 'using > cached catalog' message. > > I am manually starting/stopping puppetd for these tests. I started it > again without '--test' option but this time it couldn't retrieve > (cached) catalog. It failed (or rather skipped catalog run) with > following messages: > > {{{ > Apr 9 16:15:11 one-23 puppet-agent[24242]: Could not retrieve catalog > from remote server: Error 400 on SERVER: validate_re(): "mysq" does > not match ["mysql", "sqlite"] at /etc/puppet/manifests/classes/ > teststdlib.pp:5 on node one-23... > Apr 9 16:15:11 one-23 puppet-agent[24242]: Using cached catalog > Apr 9 16:15:11 one-23 puppet-agent[24242]: Could not retrieve > catalog; skipping run > }}} > > If I use '--test' option then I get 'error 400' immediately and > puppetd doesn't get started as well. > This all sounds like Puppet is behaving exactly as I expect it to. > Since it once worked for me even without '--test' option I am > wondering how long does a node keep cache? Is cache dependent on any > factors other than time interval? > Puppet caches the last "good" (compiled) catalog it received from the master indefinitely. The purpose is that if you have a syntax error in your manifests, Puppet will still manage the system using the last known good catalog. Once the syntax error is fixed, the new catalog will replace the old catalog in the agent's cache. -Jeff -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.