Update package (latest) only if installed in Debian

132 views
Skip to first unread message

Ximena Cardinali

unread,
Feb 24, 2015, 3:28:32 PM2/24/15
to puppet...@googlegroups.com
Hello There,

I'm trying to write a module to update certain vulnerable packages in Debian Systems.
My idea is to update them only and only if they are installed. Is there any exec command or any other tricks that you may know to do that?

So far, I've got the basics: :$

        package { '$package_update':
                name            => $package_update,
                ensure          => latest,
        }

Can anyone throw me an idea? I will really appreciate it!

Cheers,
Ximena.

David Schmitt

unread,
Feb 24, 2015, 3:43:06 PM2/24/15
to puppet...@googlegroups.com
On 2015-02-24 16:28, Ximena Cardinali wrote:
> Hello There,
>
> I'm trying to write a module to update certain vulnerable packages in
> Debian Systems.
> My idea is to update them only and only if they are *installed*. Is
> there any exec command or any other tricks that you may know to do that?
>
> So far, I've got the basics: :$
>
> package { '$package_update':
> name => $package_update,
> ensure => latest,
> }
>
> Can anyone throw me an idea? I will really appreciate it!

What about "aptitude full-upgrade"?

Regards, David

--
* Always looking for people I can help with awesome projects *
Twitter: @dev_el_ops G+: https://plus.google.com/+DavidSchmitt
Blog: http://club.black.co.at/log/
LinkedIn: http://at.linkedin.com/in/davidschmitt

Ximena Cardinali

unread,
Feb 24, 2015, 3:47:06 PM2/24/15
to puppet...@googlegroups.com
I just want to upgrade specific Packages.

The idea is something like : ensure=>latest, onlyif=>present

Cheers,
Ximena.

Charles Yeomans

unread,
Feb 24, 2015, 3:55:20 PM2/24/15
to puppet...@googlegroups.com
Probably the simplest approach would be to write an exec resource using the command

/usr/bin/apt-get install --only-upgrade <package-name>

for apt packages.



Charles Yeomans
> --
> 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 puppet-users...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/72682c9d-5194-4cf9-9b65-729eebd77645%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Raphink

unread,
Feb 25, 2015, 10:49:05 AM2/25/15
to puppet...@googlegroups.com
Hello,


It seems that you're trying to use Puppet for actions (upgrading packages not managed by Puppet) instead of state. This is not what Puppet is for. You might want to setup unattended-upgrades with the proper Allowed-Origins and let the system upgrade the packages for you.


Cheers,

Raphaël

Ximena Cardinali

unread,
Feb 27, 2015, 11:09:13 AM2/27/15
to puppet...@googlegroups.com
Thanks a lot everyone for the answers! 

I will try to go for the "/usr/bin/apt-get install --only-upgrade <package-name>" but maybe outside of puppet.

Cheers,
Ximena.


---
Ximena E. Cardinali | Linux Systems Administrator
Mobile: +49-1514-72-96-542 | Skype: ximena_cardinali

--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/MhmLUXre2CI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/ebbcf94b-079f-4ea3-9bb4-7f35b45672a9%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages