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: [email protected] on behalf of Kai Stian Olstad 
<[email protected]>
Sent: Saturday, May 18, 2019 11:27 AM
To: [email protected]
Subject: Re: [ansible-project] Verify package before install

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

--
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 [email protected].
To post to this group, send email to [email protected].
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.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/DM5PR0801MB36569BC5ED95AD85D4AA7557A6040%40DM5PR0801MB3656.namprd08.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to