On Mon, May 24, 2010 at 7:07 AM, Daniel Pittman <dan...@rimspace.net> wrote:

> Matt Southerden <southerde...@googlemail.com> writes:
>
> > I'm new to puppet, and I have a couple of apt related problems I'm
> > struggling to find solutions to.
> >
> > Firstly, we'd like to run an apt-get upgrade the very first time a
> > node goes under puppet's control. Is there a good way to do this?
>
> No.  The next release will be easier, but for now you need to be very, very
> careful to get ordering right.  We have, roughly, this structure:
>
> class apt::config {
>  # install sources.list, and other *files* required for apt
> }
>
> class apt {
>  exec { "/usr/bin/aptitude update": require => Class["apt::config"]
> }
>
> Package { require => Class["apt"] }
>
> That helps ensure that the aptitude update runs before any package install
> in
> puppet, but is ugly.  The next release (as I understand the roadmap) will
> improve this by having "stages" where you can arrange it with less trouble.
>

It's not actually that bad.  I tend to create a whole class just for the
update commands and set a global resource default require as Daniel has
shown.

Another option is to create your own defined type, say "apt_package" that
takes into account the local customizations at your site that wraps a normal
package type with all the right dependencies.

I'm finding this is more flexible, simply because you can set the
require/before however you like on individual resources without having to
worry about overriding the global resource default, or know what it is.




>
> [...]
>
>
> [...]
>
> > But reading the docs (and trying this out manually) the require parameter
> > doesn't trigger the exec (so I have no idea how all these people are
> getting
> > it to work *shrug*, or maybe they just think it's working...)
>
> Drop the 'refreshonly' in the apt update 'exec', and it will work. :)
>
>        Daniel
>
> --
> ✣ Daniel Pittman            ✉ dan...@rimspace.net            ☎ +61 401 155
> 707
>               ♽ made with 100 percent post-consumer electrons
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com<puppet-users%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


-- 
nigel

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@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.

Reply via email to