yum install @group

47 views
Skip to first unread message

Hilco Wijbenga

unread,
Sep 16, 2014, 1:36:37 PM9/16/14
to Ansible Project
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

Michael DeHaan

unread,
Sep 16, 2014, 1:43:37 PM9/16/14
to ansible...@googlegroups.com
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).




--
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/CAE1pOi2BAxM_bPivydM%3DJf%2BDyvng0AKEr276ZKxLs7dbBRKSjg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hilco Wijbenga

unread,
Sep 16, 2014, 1:56:48 PM9/16/14
to Ansible Project
On 16 September 2014 10:43, Michael DeHaan <mic...@ansible.com> wrote:
> It looks like we don't have a ticket open on this one - if you'd like to
> file one, we'd appreciate it.

Done: https://github.com/ansible/ansible/issues/9030 .

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

Michael DeHaan

unread,
Sep 16, 2014, 1:59:45 PM9/16/14
to ansible...@googlegroups.com
Not really a good one, no.

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



--
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.

Hilco Wijbenga

unread,
Sep 16, 2014, 2:51:25 PM9/16/14
to Ansible Project
On 16 September 2014 10:59, Michael DeHaan <mic...@ansible.com> wrote:
> Perhaps install the packages you need instead of a group, or ignore the
> changed state.

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. :-)

Patrick Ansible-ML

unread,
Sep 16, 2014, 4:58:17 PM9/16/14
to ansible...@googlegroups.com
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] => {
"yum_results": {
"changed": true,
"invocation": {
"module_args": "name='@development' state=latest",
"module_name": "yum"
},
"msg": "",
"rc": 0,
"results": [
"No packages marked for update\n"
]
}
}

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

- name: next task
yum: name=otherpackage state=latest
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

HTH,
Patrick
Reply all
Reply to author
Forward
0 new messages