Hi all, We have some data in SVN repos and I''d like puppet to ensure that a) the latest copy is checked out, and b) reload a service if it is updated. So I''ve configured the vcsrepo type (http://forge.puppetlabs.com/puppetlabs/vcsrepo). However when I subscribe to the vcsrepo resource, it is always refreshed, irrespective of whether the repository is upto date or not. I''d prefer not to reload the service everytime puppet runs on the client. My test manifest ... vcsrepo { "/tmp/repo": ensure => latest, provider => svn, source => "svn+ssh://me@host/repo", } exec {"/bin/date": subscribe => Vcsrepo["/tmp/repo"], } Does anyone have any suggestions on how I can get this to only refresh when the repo is updated? I''ve tried looking at how it is done in the file and package types, but my ruby/puppet architecture knowledge is not yet upto that. 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.
James Turnbull
2010-Jul-13 15:13 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
Michael Can you provide logs so I can see what''s happening --debug please. Thanks James Turnbull On 12/07/2010, at 11:12 PM, Michael Knox <michael.knox.au@gmail.com> wrote:> > > Hi all, > We have some data in SVN repos and I''d like puppet to ensure that a) the > latest copy is checked out, and b) reload a service if it is updated. > So I''ve configured the vcsrepo type > (http://forge.puppetlabs.com/puppetlabs/vcsrepo). > > However when I subscribe to the vcsrepo resource, it is always > refreshed, irrespective of whether the repository is upto date or not. > I''d prefer not to reload the service everytime puppet runs on the client. > > My test manifest ... > > vcsrepo { "/tmp/repo": > ensure => latest, > provider => svn, > source => "svn+ssh://me@host/repo", > } > > exec {"/bin/date": > subscribe => Vcsrepo["/tmp/repo"], > } > > Does anyone have any suggestions on how I can get this to only refresh > when the repo is updated? > I''ve tried looking at how it is done in the file and package types, but > my ruby/puppet architecture knowledge is not yet upto that. > > 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. >-- 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.
Michael Knox
2010-Jul-13 20:58 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
James, On 14/07/10 1:13 AM, James Turnbull wrote:> Michael > > Can you provide logs so I can see what''s happening --debug please. >Client debug log attached. There was nothing on the puppetmaster (also --debug).> Thanks > > James Turnbull > > > > On 12/07/2010, at 11:12 PM, Michael Knox<michael.knox.au@gmail.com> wrote: > >> >> Hi all, >> We have some data in SVN repos and I''d like puppet to ensure that a) the >> latest copy is checked out, and b) reload a service if it is updated. >> So I''ve configured the vcsrepo type >> (http://forge.puppetlabs.com/puppetlabs/vcsrepo). >> >> However when I subscribe to the vcsrepo resource, it is always >> refreshed, irrespective of whether the repository is upto date or not. >> I''d prefer not to reload the service everytime puppet runs on the client. >> >> My test manifest ... >> >> vcsrepo { "/tmp/repo": >> ensure => latest, >> provider => svn, >> source => "svn+ssh://me@host/repo", >> } >> >> exec {"/bin/date": >> subscribe => Vcsrepo["/tmp/repo"], >> } >> >> Does anyone have any suggestions on how I can get this to only refresh >> when the repo is updated? >> I''ve tried looking at how it is done in the file and package types, but >> my ruby/puppet architecture knowledge is not yet upto that. >> >> 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. >>-- 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.
Micheal, What directory and what file name did you put your test mainifest in? On Jul 13, 2:12 am, Michael Knox <michael.knox...@gmail.com> wrote:> Hi all, > We have some data in SVN repos and I''d like puppet to ensure that a) the > latest copy is checked out, and b) reload a service if it is updated. > So I''ve configured thevcsrepotype > (http://forge.puppetlabs.com/puppetlabs/vcsrepo). > > However when I subscribe to thevcsreporesource, it is always > refreshed, irrespective of whether the repository is upto date or not. > I''d prefer not to reload the service everytime puppet runs on the client. > > My test manifest ... > > vcsrepo{ "/tmp/repo": > ensure => latest, > provider => svn, > source => "svn+ssh://me@host/repo", > > } > > exec {"/bin/date": > subscribe => Vcsrepo["/tmp/repo"], > > } > > Does anyone have any suggestions on how I can get this to only refresh > when the repo is updated? > I''ve tried looking at how it is done in the file and package types, but > my ruby/puppet architecture knowledge is not yet upto that. > > 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.
at the risk of sounding dense here, is it updating because the result of /bin/date is always going to be unique? maybe you can trigger it some other way, like with a comparison. On Jul 13, 2:12 am, Michael Knox <michael.knox...@gmail.com> wrote:> Hi all, > We have some data in SVN repos and I''d like puppet to ensure that a) the > latest copy is checked out, and b) reload a service if it is updated. > So I''ve configured the vcsrepo type > (http://forge.puppetlabs.com/puppetlabs/vcsrepo). > > However when I subscribe to the vcsrepo resource, it is always > refreshed, irrespective of whether the repository is upto date or not. > I''d prefer not to reload the service everytime puppet runs on the client. > > My test manifest ... > > vcsrepo { "/tmp/repo": > ensure => latest, > provider => svn, > source => "svn+ssh://me@host/repo", > > } > > exec {"/bin/date": > subscribe => Vcsrepo["/tmp/repo"], > > } > > Does anyone have any suggestions on how I can get this to only refresh > when the repo is updated? > I''ve tried looking at how it is done in the file and package types, but > my ruby/puppet architecture knowledge is not yet upto that. > > 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.
never mind… haven''t had coffee yet. On Jul 14, 9:11 am, nate <foil...@gmail.com> wrote:> at the risk of sounding dense here, is it updating because the result > of /bin/date is always going to be unique? maybe you can trigger it > some other way, like with a comparison. > > On Jul 13, 2:12 am, Michael Knox <michael.knox...@gmail.com> wrote: > > > > > Hi all, > > We have some data in SVN repos and I''d like puppet to ensure that a) the > > latest copy is checked out, and b) reload a service if it is updated. > > So I''ve configured the vcsrepo type > > (http://forge.puppetlabs.com/puppetlabs/vcsrepo). > > > However when I subscribe to the vcsrepo resource, it is always > > refreshed, irrespective of whether the repository is upto date or not. > > I''d prefer not to reload the service everytime puppet runs on the client. > > > My test manifest ... > > > vcsrepo { "/tmp/repo": > > ensure => latest, > > provider => svn, > > source => "svn+ssh://me@host/repo", > > > } > > > exec {"/bin/date": > > subscribe => Vcsrepo["/tmp/repo"], > > > } > > > Does anyone have any suggestions on how I can get this to only refresh > > when the repo is updated? > > I''ve tried looking at how it is done in the file and package types, but > > my ruby/puppet architecture knowledge is not yet upto that. > > > 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.
Bort On Jul 14, 11:03 pm, bmort <propertywholesa...@gmail.com> wrote:> Micheal, > > What directory and what file name did you put your test mainifest in? >The I have puppet-vcsrepo (which is simply a git clone from the repo) in my $$modulepath. Then in my test env I have that test manifest below in site.pp. This test env is only for playing with vcsrepo. In the env I''m building the vcsrepo types are declared in the relevant manifests. In this case my DNS management module as we have all the zone files in SVN.> On Jul 13, 2:12 am, Michael Knox <michael.knox...@gmail.com> wrote: > > > Hi all, > > We have some data in SVN repos and I''d like puppet to ensure that a) the > > latest copy is checked out, and b) reload a service if it is updated. > > So I''ve configured thevcsrepotype > > (http://forge.puppetlabs.com/puppetlabs/vcsrepo). > > > However when I subscribe to thevcsreporesource, it is always > > refreshed, irrespective of whether the repository is upto date or not. > > I''d prefer not to reload the service everytime puppet runs on the client. > > > My test manifest ... > > > vcsrepo{ "/tmp/repo": > > ensure => latest, > > provider => svn, > > source => "svn+ssh://me@host/repo", > > > } > > > exec {"/bin/date": > > subscribe => Vcsrepo["/tmp/repo"], > > > } > > > Does anyone have any suggestions on how I can get this to only refresh > > when the repo is updated? > > I''ve tried looking at how it is done in the file and package types, but > > my ruby/puppet architecture knowledge is not yet upto that. > > > 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.
Corey Ralph
2010-Jul-15 00:35 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
Hi Michael, On 13/07/2010, at 4:12 PM, Michael Knox wrote:> > exec {"/bin/date": > subscribe => Vcsrepo["/tmp/repo"], > } > > Does anyone have any suggestions on how I can get this to only refresh > when the repo is updated?You need to add refreshonly => true to that exec. Cheers Corey -- 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.
Michael Knox
2010-Jul-15 01:50 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
Thanks Corey, On 15/07/10 10:35 AM, Corey Ralph wrote:> Hi Michael, > > On 13/07/2010, at 4:12 PM, Michael Knox wrote: >> >> exec {"/bin/date": >> subscribe => Vcsrepo["/tmp/repo"], >> } >> >> Does anyone have any suggestions on how I can get this to only refresh >> when the repo is updated? > > You need to add refreshonly => true to that exec. >Tried adding that, but it didn''t make any difference. The issue is when puppet is processing the vcsrepo type, and before it processes the exec type (in this test, in production it will be a service). From the log ... notice: //Vcsrepo[/tmp/repo]/ensure: ensure changed ''present'' to ''latest'' info: //Vcsrepo[/tmp/repo]: Scheduling refresh of Exec[/bin/date] Vcsrepo has scheduled a refresh of the Exec when it shouldn''t have (IMO), i.e. the svn checkout was already upto date and therefore hadn''t changed. Cheers Mike -- 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.
Michael Knox
2010-Jul-16 02:36 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
ok, So I think I now have it sorted ... I''ve added an insync? method to the type to override the inherited method, as well as making some tweaks in the svn provider. Seems to work correctly now with svn so I''ll tidy up my code and submit a patch/diff. Cheers> > On 12/07/2010, at 11:12 PM, Michael Knox<michael.knox.au@gmail.com> wrote: > >> >> Hi all, >> We have some data in SVN repos and I''d like puppet to ensure that a) the >> latest copy is checked out, and b) reload a service if it is updated. >> So I''ve configured the vcsrepo type >> (http://forge.puppetlabs.com/puppetlabs/vcsrepo). >> >> However when I subscribe to the vcsrepo resource, it is always >> refreshed, irrespective of whether the repository is upto date or not. >> I''d prefer not to reload the service everytime puppet runs on the client. >> >> My test manifest ... >> >> vcsrepo { "/tmp/repo": >> ensure => latest, >> provider => svn, >> source => "svn+ssh://me@host/repo", >> } >> >> exec {"/bin/date": >> subscribe => Vcsrepo["/tmp/repo"], >> } >> >> Does anyone have any suggestions on how I can get this to only refresh >> when the repo is updated? >> I''ve tried looking at how it is done in the file and package types, but >> my ruby/puppet architecture knowledge is not yet upto that. >> >> 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. >>-- 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.
James Turnbull
2010-Jul-16 03:11 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
Michael Knox wrote:> ok, > So I think I now have it sorted ... > I''ve added an insync? method to the type to override the inherited > method, as well as making some tweaks in the svn provider. > Seems to work correctly now with svn so I''ll tidy up my code and submit > a patch/diff.Michael Yes I thought that would be the issue - the same problem existed in the Git provider. Was intending to look at the code but other things came up. Happy to take patches. Thanks James Turnbull -- Puppet Labs - http://www.puppetlabs.com C: 503-734-8571 -- 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.
Michael Knox
2010-Jul-16 06:24 UTC
Re: [Puppet Users] vcsrepo type, svn, & ensure => latest
Well to wrap this up, I''ve created a diff and submitted to the puppet-dev list (https://groups.google.com/group/puppet-dev/browse_thread/thread/6f6735933f362892?hl=en#). Code is available at http://github.com/mikeknox/puppet-vcsrepo/tree/bug/svn-update. <http://www.google.com/url?sa=D&q=http://github.com/mikeknox/puppet-vcsrepo/tree/bug/svn-update&usg=AFQjCNFJOsk03i5oFSnSK8C14qVhfa3Wqw> Cheers Mike -- 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.