On Tuesday, February 25, 2014 8:17:56 AM UTC-6, kbrede wrote:
>
> I've got a situation where I need to remove a set of packages and then 
> install the upgraded versions.  I can't just upgrade.  It's rare that I 
> have to upgrade the software but I'd like to have something in place to 
> upgrade when I have to.  What's the best way to handle these types of 
> situations with Puppet?
>


The best way is to use decent packages, which for this purpose means ones 
that don't require previous versions to be removed first.  Packages that do 
not support that are fairly rare, even on Windows, which overall has 
sub-par package management capabilities (through no fault of Puppet's).

 

>
> Is there anyway to force $purge_pkgs to run and then have $install_pkgs 
> run after on the same run?
>


You can tell puppet to apply some resources before others, but you cannot 
put two resources of the same type and having the same name or title into 
the same catalog.

 

>   As written below, I think what happens is the packages are uninstalled 
> but when the compile runs, $install_pkgs are already installed, so it does 
> nothing.   
>


Nope.  What happens is one of these things:

   - None of the packages in $install_pkgs is also in $purge_pkgs (and note 
   that these need to be single package names or arrays, not delimited lists)
   - $upg != 'yes'
   - Catalog compilation fails.  Either no catalog or a cached catalog is 
   applied.
   
If the packages to be purged and those to be installed all have different 
names, then you have a comparatively simple problem.  You can use 
relationship (chaining) arrows together with resource collectors to declare 
that Puppet should perform the purges before the installs.

If you want to purge and then reinstall the same package in the same run, 
then I suggest you give up using Package resources for any of it.  Use one 
or more Execs for the whole thing, instead.


John

 

-- 
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/a5a34299-2d8b-49d3-bcbd-45c4e455525f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to