Hi all, 

I resolve this using something like this:

yum: pkg=httpd-{{ httpd_version | default('*') }} state=latest
as the documentation says :
"Package name, or package specifier with version, like name-1.0. When using 
state=latest, this can be '*' which means run: yum -y update. You can also 
pass a url or a local path to a rpm file."

Hope that helps

El miércoles, 21 de agosto de 2013 08:27:09 UTC-3, Byron Schlemmer escribió:
>
> Hi all,
>
> I'm trying to work out the best way to either install the latest version 
> or a specified version of a package dependent on a group_vars variable 
> passed. 
>
> That is, my group_vars/group contains:
>
> mypackage: 1.0
>
> But it could be changed to 
>
> mypackage: latest
>
> And I want package installation to occur accordingly.
>
> My play has:
>
> - name: install mypackage rpm
>   yum:  name=mypackage state=latest
>   when: mypackage_version == "latest"
>
> - name: install mypackage rpm
>   yum:  name=mypackage-{{ mypackage_version }} state=installed
>   when: mypackage_version != "latest"
>
> Now this works but I end up with output from both packages:
>
> TASK: [install mypackage rpm]
> ****************************************
> ok: [myhost00]
>
> TASK: [install mypackage rpm]
> ****************************************
> skipping: [myhost00]
>
> Is there a way to silence the output on the task that did not run? Is this 
> the best way to accomplish this or should I abstract with an include in 
> some fashion?
>
> Thanks,
>
>
>

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/c8ebc35e-6158-4810-8483-cfd90a125082%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to