Douglas Garstang
2012-Aug-09 17:10 UTC
[Puppet Users] Running apt-get update on package install
I''m on Ubuntu, and I wanted to always have ''apt-get update'' run before attempting to install packages, so I put this in my top level site.pp file: exec { ''refresh-repos'': command => ''/usr/bin/apt-get update''; } Package { require => Exec[''refresh-repos''] } However, that causes a nasty cyclic dependency error. I really HATE those because the error message makes it impossible to interpret what''s actually going on. How can I do this without the awful cyclic error messages? Doug. -- 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
2012-Aug-09 17:20 UTC
Re: [Puppet Users] Running apt-get update on package install
On Thu, Aug 9, 2012 at 10:10 AM, Douglas Garstang <doug.garstang@gmail.com> wrote:> I''m on Ubuntu, and I wanted to always have ''apt-get update'' run before > attempting to install packages, so I put this in my top level site.pp > file: > > exec { > ''refresh-repos'': > command => ''/usr/bin/apt-get update''; > } > > Package { > require => Exec[''refresh-repos''] > } > > However, that causes a nasty cyclic dependency error. I really HATE > those because the error message makes it impossible to interpret > what''s actually going on. > > How can I do this without the awful cyclic error messages?What version of Puppet are you on? Can you paste or link to the error message itself so we can actually tell what the dependency cycle is? -- 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 10/08/2012, at 3:20, Nigel Kersten <nigel@puppetlabs.com> wrote:> On Thu, Aug 9, 2012 at 10:10 AM, Douglas Garstang > <doug.garstang@gmail.com> wrote: >> I''m on Ubuntu, and I wanted to always have ''apt-get update'' run before >> attempting to install packages, so I put this in my top level site.pp >> file: >> >> exec { >> ''refresh-repos'': >> command => ''/usr/bin/apt-get update''; >> } >> >> Package { >> require => Exec[''refresh-repos''] >> } >> >> However, that causes a nasty cyclic dependency error. I really HATE >> those because the error message makes it impossible to interpret >> what''s actually going on. >> >> How can I do this without the awful cyclic error messages? > > What version of Puppet are you on? Can you paste or link to the error > message itself so we can actually tell what the dependency cycle is? >I have used stages to handle this sort of thing. Setting up a repo stage to refresh repos before the main stage. http://docs.puppetlabs.com/references/stable/metaparameter.html#stage Cheers -- 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
2012-Aug-10 15:35 UTC
Re: [Puppet Users] Running apt-get update on package install
On Thu, Aug 9, 2012 at 2:00 PM, Denmat <tu2bgone@gmail.com> wrote:> > > On 10/08/2012, at 3:20, Nigel Kersten <nigel@puppetlabs.com> wrote: > >> On Thu, Aug 9, 2012 at 10:10 AM, Douglas Garstang >> <doug.garstang@gmail.com> wrote: >>> I''m on Ubuntu, and I wanted to always have ''apt-get update'' run before >>> attempting to install packages, so I put this in my top level site.pp >>> file: >>> >>> exec { >>> ''refresh-repos'': >>> command => ''/usr/bin/apt-get update''; >>> } >>> >>> Package { >>> require => Exec[''refresh-repos''] >>> } >>> >>> However, that causes a nasty cyclic dependency error. I really HATE >>> those because the error message makes it impossible to interpret >>> what''s actually going on. >>> >>> How can I do this without the awful cyclic error messages? >> >> What version of Puppet are you on? Can you paste or link to the error >> message itself so we can actually tell what the dependency cycle is? >> > I have used stages to handle this sort of thing. Setting up a repo stage to refresh repos before the main stage. > > http://docs.puppetlabs.com/references/stable/metaparameter.html#stageThat''s true, but stages aren''t required to make this work. It''s impossible for us to tell why there is a dependency cycle here without more info. -- 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.