Using yum module to install gnome-desktop-environment on CentOS 7 does not work

HI

I am working on a role here:

https://github.com/DevOps4Networks/ansible-linux-desktop-role

Which is used in a Packer build here:

https://github.com/DevOps4Networks/opendaylight-integration-packaging-devtools/tree/master/packer

When I attempt to use the yum module to install the group gnome-desktop-environment I get the first result below, which reports: “No packages marked for update”. Note that I have also tried “state=present” which reports that there is nothing to do (virtualbox-iso: ok: [localhost] => {“changed”: false, “msg”: “”, “rc”: 0, “results”: [“@gnome-desktop-environment: Nothing to do”]}).

When I change to use a shell command to invoke yum to groupinstall gnome-desktop-environment the install works, which is shown in the second result below.

I am either missing a trick here, or this is just plain wrong.

Any ideas anyone?

Many thanks

Nathan

First result

A colleague suggested that I also try with @GNOME Desktop"

The result is below. This is the same outcome as trying the gnome-desktop-environment form of the group name, which is to say that the response is “Nothing to do”.

I know that this is not correct, as manually trying the same install does work, as does using a shall command, so I think that this is broken.

virtualbox-iso: TASK: [ansible-linux-desktop | Install RedHat Gnome desktop] ******************
virtualbox-iso: REMOTE_MODULE yum name= Desktop" state=present
virtualbox-iso: EXEC [‘/bin/sh’, ‘-c’, ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337 && echo $HOME/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337’]
virtualbox-iso: PUT /tmp/tmp36wo8c TO /home/vagrant/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337/yum
virtualbox-iso: EXEC /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=epnfbkhdzrrresbocmxmjznkvqquwkmm] password: " -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-epnfbkhdzrrresbocmxmjznkvqquwkmm; LANG=C LC_CTYPE=C /usr/bin/python -tt /home/vagrant/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337/yum; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337/ >/dev/null 2>&1’”‘"’’
virtualbox-iso: ok: [localhost] => {“changed”: false, “msg”: “”, “rc”: 0, “results”: [“@GNOME Desktop: Nothing to do”]}

Hi

Can you try to install GNOME group, like yum: name=“@GNOME” state=latest

The difference is that GNOME is package group while GNOME Desktop is environment group. It could be that yum module supports only package groups.

Edgars

trešdiena, 2015. gada 21. oktobris 11:54:51 UTC+2, Nathan Sowatskey rakstīja:

Hi Edgars

Thanks for that :slight_smile:

The install process worked, i.e. “Completed”, but what was installed was not quite what I wanted, as the X portions were still missing. So, a good test, but something is still amiss here.

I’ll wait a bit to see if anyone else has anything to say, then create an issue for the GitHub Ansible project pointing to this thread.

Regards

Nathan

As a workaround, instead of installing GNOME Desktop environment group, you can install two package groups: GNOME and ‘X Window System’.

Edgars

trešdiena, 2015. gada 21. oktobris 15:43:52 UTC+2, Nathan Sowatskey rakstīja:

Many thanks, I’ll try that.

Regards

Nathan

We’ve found an answer to this mystery on the bug report https://github.com/ansible/ansible/issues/12873 that was posted. For those who are interested, yum apparently has two types of groups that it knows about, package groups and environment groups: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sec-Working_with_Package_Groups.html

In some yum subcommands yum will handle both types transparently. For instance: “yum groups install gnome-desktop-environment”. Unfortunately, ansible needs to install all packages in a single transaction to avoid some cornercases with package dependencies. So we don’t specifically use groups install. Instead we specify that certain names are groups instead of packages like this: “yum install @development-tools”. When groups are given to the install command, you need to specify package groups and environment groups using slightly different syntax. Since the gnome-desktop-environment group is an environmental group, its syntax is like this: @^gnome-deskop-environment. So the yum command is: “yum install @development-tools @^gnome-desktop-environment”.

Specifying that to ansible is then simply:

  • yum:
    name:
  • @development-tools
  • “@^gnome-desktop-environment”
    state: latest

You can tell which type of group you are dealing with by doing a “yum group list” and looking for which category your desired group falls under in the output.

-Toshio