Re: [ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-16 Thread 张斌
Ah, cool, state=latest, thanks guys!! -- 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 grou

Re: [ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-16 Thread Dick Davies
I think yours is bang on, if 张斌 really wants to keep his attempt they can just remove all but the 'Update Package only if installed' yum task, the other 2 are redundant. On 15 December 2015 at 17:03, cmacrae wrote: > Ah okay, cool :) > > Hmm, well, does my solution above still not stand? > I mean

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread Evgen Morokin
Hi, example from previous reply will do all stages for you: - name: Ensure packages are installed and the latest available version yum: name="{{ item }}" state=latest with_items: - some_package - some_other_package - a_third_package This will check package presence, then install

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread Vince Skahan
Perhaps you could do a little test to verify the original answer you got worked (or did not). Install an old rpm manually Install a current rpm manually Write a playbook using ensure=latest referencing both You should see it updated the old one to current, and left the already current one alone

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread cmacrae
Ah okay, cool :) Hmm, well, does my solution above still not stand? I mean, with your above pseudo code, the second task will install the package if it's not present, in doing so, it will install the latest package. The third task will just ensure any packages in the list installed are at their

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread 张斌
Thanks Calum. I already went through the docs, and googled. I know how to loop with items and install with yum. But i want to a list of RPMs to be check and install/upgrade, not sure if there is a way to do so. how to loop with_items: for the three steps ? Perhaps something like the follow

[ansible-project] Re: help: install/upgrade a list of RPMs

2015-12-15 Thread cmacrae
Hey, I'd recommend you read fully through the 'Getting Started ' guide, and carry on reading through the other docs - reading these and implementing/playing with what they teach is the quickest, most efficient way to learn. That said