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

2,036 views
Skip to first unread message

Nathan Sowatskey

unread,
Oct 20, 2015, 9:27:41 AM10/20/15
to Ansible Project
HI

I am working on a role here:


Which is used in a Packer build here:


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

With RedHat.yml with:

- name: Install RedHat Gnome desktop
#TODO: In theory one should be able to do this:
  yum: name="@gnome-desktop-environment" state=latest
#BUT, I have been unable to get that to work, so:
 #shell: yum -y groupinstall gnome-desktop-environment

I get:

virtualbox-iso: TASK: [ansible-linux-desktop | Install RedHat Gnome desktop] ******************
    virtualbox-iso: <localhost> REMOTE_MODULE yum name= state=latest
    virtualbox-iso: <localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836 && echo $HOME/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836']
    virtualbox-iso: <localhost> PUT /tmp/tmpUXuUTj TO /home/vagrant/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836/yum
    virtualbox-iso: <localhost> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=uvezdafkleudwpucmmsrzghddspdlqad] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-uvezdafkleudwpucmmsrzghddspdlqad; LANG=C LC_CTYPE=C /usr/bin/python -tt /home/vagrant/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836/yum; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1445340469.26-97807224264836/ >/dev/null 2>&1'"'"''
    virtualbox-iso: changed: [localhost] => {"changed": true, "msg": "Warning: Package group gnome-desktop-environment does not exist.\n", "rc": 0, "results": ["Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: mirror.tedra.es\n * epel: ftp.rediris.es\n * extras: mirror.tedra.es\n * updates: mirror.tedra.es\nNo packages marked for update\n"]}

Second result
-------------------

When I change to:

- name: Install RedHat Gnome desktop
#TODO: In theory one should be able to do this:
#yum: name="@gnome-desktop-environment" state=latest
#BUT, I have been unable to get that to work, so:
  shell: yum -y groupinstall gnome-desktop-environment

I get:

TASK: [ansible-linux-desktop | Install RedHat Gnome desktop] ******************
    virtualbox-iso: <localhost> REMOTE_MODULE command yum -y groupinstall gnome-desktop-environment #USE_SHELL
    virtualbox-iso: <localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714 && echo $HOME/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714']
    virtualbox-iso: <localhost> PUT /tmp/tmpG7lqPk TO /home/vagrant/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714/command
    virtualbox-iso: <localhost> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=cibzbkzumoqutznqhwjsvofqejqxvchg] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-cibzbkzumoqutznqhwjsvofqejqxvchg; LANG=C LC_CTYPE=C /usr/bin/python /home/vagrant/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714/command; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1445343827.26-139550713552714/ >/dev/null 2>&1'"'"''
    virtualbox-iso: changed: [localhost] => {"changed": true, "cmd": "yum -y groupinstall gnome-desktop-environment", "delta": "0:05:35.508381", "end": "2015-10-20 12:29:22.840576", "rc": 0, "start": "2015-10-20 12:23:47.332195", "stderr": "", "stdout": "Loaded plugins: fastestmirror, langpacks\nLoading mirror speeds from cached hostfile\n * base: centos.mirror.xtratelecom.es\n * epel: ftp.cica.es\n * extras: centos.mirror.xtratelecom.es\n * updates: centos.mirror.xtratelecom.es\nResolving Dependencies\n--> Running transaction check\n---> Package ModemManager.x86_64 0:1.1.0-6.git20130913.el7 will be installed\n--> Processing Dependency: ModemManager-glib(x86-64) = 1.1.0-6.git20130913.el7 for package: ModemManager-1.1.0-6.git20130913.el7.x86_64\n--> Processing Dependency: libqmi-glib.so.1()(64bit) for package: ModemManager-1.1.0-6.git20130913.el7.x86_64\n--> Processing Dependency: libmm-glib.so.0()(64bit) for package:

[Lots of lines elided]
...

\n  xorg-x11-xkb-utils.x86_64 0:7.7-9.1.el7                                       \n  yelp-libs.x86_64 1:3.8.1-7.el7                                                \n  yelp-xsl.noarch 0:3.8.1-2.el7                                                 \n  zenity.x86_64 0:3.8.0-4.el7                                                   \n\nComplete!", "warnings": ["Consider using yum module rather than running yum"]}

Nathan Sowatskey

unread,
Oct 21, 2015, 5:54:51 AM10/21/15
to Ansible Project
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: <localhost> REMOTE_MODULE yum name= Desktop" state=present
    virtualbox-iso: <localhost> 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: <localhost> PUT /tmp/tmp36wo8c TO /home/vagrant/.ansible/tmp/ansible-tmp-1445414341.08-121472318185337/yum
    virtualbox-iso: <localhost> 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"]}

Edgars

unread,
Oct 21, 2015, 7:23:41 AM10/21/15
to Ansible Project
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

Nathan Sowatskey

unread,
Oct 21, 2015, 9:43:52 AM10/21/15
to Ansible Project
Hi Edgars

Thanks for that :-)

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

Edgars

unread,
Oct 21, 2015, 10:10:34 AM10/21/15
to Ansible Project
As a workaround, instead of installing GNOME Desktop environment group, you can install two package groups: GNOME and 'X Window System'.

Edgars

Nathan Sowatskey

unread,
Oct 21, 2015, 11:05:16 AM10/21/15
to ansible...@googlegroups.com
Many thanks, I’ll try that.

Regards

Nathan
> --
> You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/ResIg2C-y_c/unsubscribe.
> To unsubscribe from this group and all its topics, 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/b7f66d11-6ca8-45fa-8f6f-3df895b9d0c2%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

tkuratomi

unread,
Oct 26, 2015, 11:48:48 AM10/26/15
to Ansible Project
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

Reply all
Reply to author
Forward
0 new messages