# yum install @group

**URL:** <https://forum.ansible.com/t/yum-install-group/16249>\
**Category:** Ansible Project\
**Created:** [September 16, 2014, 5:36pm UTC](https://forum.ansible.com/t/yum-install-group/16249 "2014-09-16T17:36:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hilco\_Wijbenga](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Hilco\_Wijbenga](https://forum.ansible.com/u/Hilco_Wijbenga)\
**Post date:** [September 16, 2014, 5:36pm UTC](https://forum.ansible.com/t/yum-install-group/16249/1 "2014-09-16T17:36:08Z")

</div>

Hi all,

I noticed that using "yum: name='@group'" always results in "changed"  
even when the group has already been installed. Is there a way to get  
"ok" when nothing needs to be done?

Cheers,  
Hilco

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 16, 2014, 5:43pm UTC](https://forum.ansible.com/t/yum-install-group/16249/2 "2014-09-16T17:43:32Z")

</div>

Yum groups are a bit of a weird thing in yum API land.

It looks like we don’t have a ticket open on this one - if you’d like to file one, we’d appreciate it.

(Particularly notable tip about yum groups, never uninstall a yum group – it does not do what you think in yum and may uninstall dependencies you wish to keep).

---

<div class="post-metadata">

**Author:** ![Hilco\_Wijbenga](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Hilco\_Wijbenga](https://forum.ansible.com/u/Hilco_Wijbenga)\
**Post date:** [September 16, 2014, 5:56pm UTC](https://forum.ansible.com/t/yum-install-group/16249/3 "2014-09-16T17:56:23Z")

</div>

Done: [https://github.com/ansible/ansible/issues/9030](https://github.com/ansible/ansible/issues/9030) .

What do I do in the meantime? Is there a workaround?

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 16, 2014, 5:59pm UTC](https://forum.ansible.com/t/yum-install-group/16249/4 "2014-09-16T17:59:40Z")

</div>

Not really a good one, no.

Perhaps install the packages you need instead of a group, or ignore the changed state.

---

<div class="post-metadata">

**Author:** ![Hilco\_Wijbenga](https://avatars.discourse-cdn.com/v4/letter/h/d2c977/32.png) [@Hilco\_Wijbenga](https://forum.ansible.com/u/Hilco_Wijbenga)\
**Post date:** [September 16, 2014, 6:50pm UTC](https://forum.ansible.com/t/yum-install-group/16249/5 "2014-09-16T18:50:59Z")

</div>

I want to rely on the state to (conditionally) execute other things so  
ignoring is not an option. Installing all the packages individually  
does work even if it is rather clumsy and not very maintenance  
friendly. 🙂

---

<div class="post-metadata">

**Author:** ![Patrick\_Ansible-ML](https://avatars.discourse-cdn.com/v4/letter/p/a88e57/32.png) [@Patrick\_Ansible-ML](https://forum.ansible.com/u/Patrick_Ansible-ML)\
**Post date:** [September 16, 2014, 8:58pm UTC](https://forum.ansible.com/t/yum-install-group/16249/6 "2014-09-16T20:58:02Z")

</div>

Perhaps you can use a 'register' in your task to get the results which can then be used as a condition in a 'when' statement in the next task?

Here's the content of a register var when a group is already installed:

TASK: [debug var=yum\_results] \*\*\*  
ok: [test.local] =\> {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"yum\_results": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"changed": true,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"invocation": {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_args": "name='@development' state=latest",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"module\_name": "yum"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"msg": "",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"rc": 0,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"results": [  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"No packages marked for update\n"  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
}

In the next task use a 'when' condition that "No packaged marked for update" should be \<what you need\>:

- name: next task  
&nbsp;&nbsp;&nbsp;yum: name=otherpackage state=latest  
&nbsp;&nbsp;&nbsp;when: yum\_results.results.find('No packages marked for update') = -1

The 'when' statement is untested and just to give an idea. More here:  
[http://docs.ansible.com/playbooks\_conditionals.html#register-variables](http://docs.ansible.com/playbooks_conditionals.html#register-variables)

HTH,  
Patrick
