# dnf module problem with modularity appstreams and groups

**URL:** <https://forum.ansible.com/t/dnf-module-problem-with-modularity-appstreams-and-groups/31435>\
**Category:** Ansible Project\
**Created:** [October 8, 2019, 12:40pm UTC](https://forum.ansible.com/t/dnf-module-problem-with-modularity-appstreams-and-groups/31435 "2019-10-08T12:40:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike2](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mike2](https://forum.ansible.com/u/mike2)\
**Post date:** [October 8, 2019, 12:40pm UTC](https://forum.ansible.com/t/dnf-module-problem-with-modularity-appstreams-and-groups/31435/1 "2019-10-08T12:40:00Z")

</div>

Ansible 2.8.5

I’m having trouble with installing package groups and modularity appstreams on a CentOS 8 host using the dnf module. Whilst it mostly seems like two separate issues, the errors I’m getting make me wonder if it’s one underlying issue.

If I try to use the dnf module to install a modularity appstream on a CentOS 8 host like this

$ ansible 192.168.122.90 -m dnf -a “name=‘@postgresql:9.6’ state=present”

I get this

192.168.122.90 | FAILED! =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“changed”: false,  
“msg”: “No group postgresql:9.6 available.”  
}

‘@postgresql:9.6’ is the example used at [Ansible collections | Ansible documentation](https://docs.ansible.com/ansible/latest/modules/dnf_module.html)

Note “No group” in the error message, which is what makes me wonder if the failure is due to the same underlying issue I’m having with package groups (below).

If I try the equivalent at the command line on the CentOS 8 host

# dnf install @postgresql:9.6

that works as expected.

If I tell Ansible to install a package group

$ ansible 192.168.122.90 dnf -m yum -a “name=‘@Development tools’ state=present”

192.168.122.90 | FAILED! =\> {  
“ansible\_facts”: {  
“discovered\_interpreter\_python”: “/usr/bin/python”  
},  
“changed”: false,  
“module\_stderr”: “Shared connection to 192.168.122.90 closed.\r\n”,  
“module\_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1569593714.55-61643763674096/AnsiballZ\_dnf.py", line 114, in \r\n \_ansiballz\_main()\r\n File "/root/.ansible/tmp/ansible-tmp-1569593714.55-61643763674096/AnsiballZ\_dnf.py", line 106, in \_ansiballz\_main\r\n invoke\_module(zipped\_mod, temp\_path, ANSIBALLZ\_PARAMS)\r\n File "/root/.ansible/tmp/ansible-tmp-1569593714.55-61643763674096/AnsiballZ\_dnf.py", line 49, in invoke\_module\r\n imp.load\_module(‘ **main** ’, mod, module, MOD\_DESC)\r\n File "/usr/lib64/python3.6/imp.py", line 235, in load\_module\r\n return load\_source(name, filename, file)\r\n File "/usr/lib64/python3.6/imp.py", line 170, in load\_source\r\n module = \_exec(spec, sys.modules[name])\r\n File "", line 618, in \_exec\r\n File "", line 678, in exec\_module\r\n File "", line 219, in \_call\_with\_frames\_removed\r\n File "/tmp/ansible\_dnf\_payload\_egtlqrub/ **main**.py", line 436, in \r\n File "/tmp/ansible\_dnf\_payload\_egtlqrub/ **main**.py", line 430, in main\r\n File "/tmp/ansible\_dnf\_payload\_egtlqrub/ **main**.py", line 293, in ensure\r\n File "/usr/lib/python3.6/site-packages/dnf/base.py", line 1587, in group\_install\r\n assert dnf.util.is\_string\_type(grp\_id)\r\nAssertionError\r\n”,  
“msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”,  
“rc”: 1

}

If I log in the CentOS 8 host and run

$ dnf install ‘@Development Tools’

that works as expected. Also this works

$ ansible 192.168.122.90 -m dnf -a “name=‘@Workstation’ state=present”

From that plus trying some other group names it seems like the dnf module can install groups so long a their name is a single word but otherwise it fails entirely.

I get the same behaviour with the yum module. (/usr/bin/yum on CentOS 8 is symlink to dnf.)

Doing the equivalent with yum module against a CentOS 7.7 target works, E.g.

$ ansible foo7 -m yum -a “name=‘@Development tools’ state=present”
