I tend to create a directory with a minimal class /etc/puppet/deployfiles 
and then another class for custom apt stuff and I have a file in 
modules/apt/files where cron does a date thingy (/bin/date > 
/etc/puppet/modules/apt/files/apt_update_time) and then I have this module 
watch for a change which notifies an Exec in my apt module to trigger an 
apt-get update. It's convoluted but it works. Similarly I have an 
apt_upgrade_time file too but I don't have a cron job updating that one - I 
just run the date command manually to get machines to perform the apt-get 
upgrade but I do have machines run apt-get update daily triggered by the 
updated file from cron.

On Monday, December 15, 2014 2:27:24 PM UTC-7, Vince Skahan wrote:
>
> In trying to spin up on puppet in a Vagrant environment, one of the things 
> I have to do to my VM is 'apt-get update' at least once to catch the base 
> box's understanding of what packages are where up to current.  That takes a 
> long enough time that I'd like to do it just once, or very rarely rather 
> than every time I run 'vagrant provision'
>
> Right now, my toplevel manifest does the update once before trying to 
> install anything.
>
> exec { "run apt-get update":
>   path    => '/usr/bin',
>   command => 'apt-get update',
> }
>
> # install and configure nginx
> class {'nginx': }
>
>
>
> Ansible has a nice feature where you can specify how long you want the 
> cache valid for, and it skips doing everything if the cache isn't that old 
> (yet)
>
>       - name: update apt cache
>        apt: update_cache=yes cache_valid_time=84600
>
>
> Is there something similar for Puppet, or can somebody suggest a 
> reasonable workaround ?
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/15545aa5-36dc-403a-aa1b-bd68c3376edc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to