Verify package before install

12 views
Skip to first unread message

Rahul Kolan

unread,
May 18, 2019, 11:22:45 AM5/18/19
to ansible...@googlegroups.com

 Hello Team,

    Need your help urgently. I want to install one rpm package, before that i want first verify package exist or not in remote system, if exist it should skip the installation, if not present install that package using command "rpm -ivh",
one more condition if package have lower version then it should upgrade the package using command "rpm -Uvh" .
I don't want to use Yum module here.

 
 


 

Thanks & Regards,

Rahul Kolan







DISCLAIMER:

This message including attachments if any intended solely for specific individual and purpose & may contain confidential material AND/OR Private Company Information. If you are not the intended recipient, any disclosure, copying or distribution of this message or any action based on it, is strictly prohibited & protected under relevant law. If you have received this communication in error, please contact the sender or delete this message immediately. Thank you for your kind cooperation.

Kai Stian Olstad

unread,
May 18, 2019, 11:27:02 AM5/18/19
to ansible...@googlegroups.com
On 18.05.2019 17:22, Rahul Kolan wrote:
> Hello Team,
>
> Need your help urgently. I want to install one rpm package, before that
> i want first verify package exist or not in remote system, if exist it
> should skip the installation, if not present install that package using
> command "*rpm -ivh*",
> one more condition if package have lower version then it should upgrade the
> package using command "*rpm -Uvh*" .
> I don't want to use *Yum* module here.

Why not, that is what the yum module is for as it fulfill every requirement you listed.


--
Kai Stian Olstad

Jonathan Lozada De La Matta

unread,
May 18, 2019, 11:36:24 AM5/18/19
to ansible...@googlegroups.com
As mentioned the yum module does everything you describe. If you don't want to use it then use shell/command with all the commands you mentioned but, its going to be more difficult. The yum modules checks if the rpm is present and installs it if you give it the correct state without anything extra.

Jonathan Lozada De La Matta on mobile
 

From: ansible...@googlegroups.com on behalf of Kai Stian Olstad <ansible-pr...@olstad.com>
Sent: Saturday, May 18, 2019 11:27 AM
To: ansible...@googlegroups.com
Subject: Re: [ansible-project] Verify package before install
 
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ff503dbb-cc46-0f32-d276-e1f7c8a14446%40olstad.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages