Hello,
I tried to downlaod "Development tools" using "@Development Tools" as package name in the task
- name: install pkg
ansible.builtin.dnf:
name: "@Development Tools"
but when i run dnf group list it isn't shown in installed groups.
when i changed it to "@RPM Development Tools" it is now shown in installed groups.
so. i'm wondering is there difference and which syntax should i use?
Thanks
Hi khokha,
Could not reproduce your case:
[root@workstation ~]# ansible localhost -m dnf -a "name='@Development tools' state=absent"
localhost | CHANGED => {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Removed: flex-2.6.1-9.el8.x86_64",
"Removed: ltrace-0.7.91-28.el8.x86_64",
"Removed: jna-4.5.1-5.el8.x86_64",
"Removed: perl-Fedora-VSP-0.001-9.el8.noarch",
"Removed: ctags-5.8-22.el8.x86_64",
"Removed: gcc-8.3.1-5.el8.x86_64",
"Removed: gcc-c++-8.3.1-5.el8.x86_64",
"Removed: gcc-gdb-plugin-8.3.1-5.el8.x86_64",
"Removed: make-1:4.2.1-10.el8.x86_64",
"Removed: gdb-8.2-11.el8.x86_64",
"Removed: annobin-8.90-1.el8.x86_64",
"Removed: perl-generators-1.10-9.el8.noarch",
"Removed: asciidoc-8.6.10-0.5.20180627gitf7c2274.el8.noarch",
"Removed: systemtap-4.2-6.el8.x86_64",
"Removed: systemtap-devel-4.2-6.el8.x86_64",
"Removed: pesign-0.112-25.el8.x86_64",
"Removed: libtool-2.4.6-25.el8.x86_64",
"Removed: glibc-devel-2.28-101.el8.x86_64",
"Removed: autoconf-2.69-27.el8.noarch",
"Removed: diffstat-1.61-7.el8.x86_64",
"Removed: automake-1.16.1-6.el8.noarch",
"Removed: redhat-rpm-config-122-1.el8.noarch",
"Removed: bison-3.0.4-10.el8.x86_64",
"Removed: rpm-build-4.14.2-37.el8.x86_64",
"Removed: rpm-sign-4.14.2-37.el8.x86_64",
"Removed: intltool-0.51.0-11.el8.noarch",
"Removed: byacc-1.9.20170709-4.el8.x86_64",
"Removed: libxcrypt-devel-4.1.1-4.el8.x86_64",
"Removed: valgrind-1:3.15.0-11.el8.x86_64",
"Removed: valgrind-devel-1:3.15.0-11.el8.x86_64",
"Removed: patchutils-0.3.4-10.el8.x86_64",
"Removed: source-highlight-3.1.8-16.el8.x86_64"
]
}
[root@workstation ~]# ansible localhost -m dnf -a "name='@RPM Development tools' state=absent"
localhost | SUCCESS => {
"changed": false,
"msg": "Nothing to do",
"rc": 0,
"results": []
}
[root@workstation ~]# ansible localhost -m dnf -a "name='@Development tools' state=present"
localhost | CHANGED => {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Group development installed.",
"Installed: libxcrypt-devel-4.1.1-4.el8.x86_64",
"Installed: patchutils-0.3.4-10.el8.x86_64",
"Installed: asciidoc-8.6.10-0.5.20180627gitf7c2274.el8.noarch",
"Installed: gcc-8.3.1-5.el8.x86_64",
"Installed: gcc-c++-8.3.1-5.el8.x86_64",
"Installed: gcc-gdb-plugin-8.3.1-5.el8.x86_64",
"Installed: redhat-rpm-config-122-1.el8.noarch",
"Installed: source-highlight-3.1.8-16.el8.x86_64",
"Installed: glibc-devel-2.28-101.el8.x86_64",
"Installed: libtool-2.4.6-25.el8.x86_64",
"Installed: autoconf-2.69-27.el8.noarch",
"Installed: diffstat-1.61-7.el8.x86_64",
"Installed: jna-4.5.1-5.el8.x86_64",
"Installed: perl-generators-1.10-9.el8.noarch",
"Installed: rpm-sign-4.14.2-37.el8.x86_64",
"Installed: rpm-build-4.14.2-37.el8.x86_64",
"Installed: valgrind-1:3.15.0-11.el8.x86_64",
"Installed: valgrind-devel-1:3.15.0-11.el8.x86_64",
"Installed: make-1:4.2.1-10.el8.x86_64",
"Installed: automake-1.16.1-6.el8.noarch",
"Installed: pesign-0.112-25.el8.x86_64",
"Installed: intltool-0.51.0-11.el8.noarch",
"Installed: gdb-8.2-11.el8.x86_64",
"Installed: perl-Fedora-VSP-0.001-9.el8.noarch",
"Installed: flex-2.6.1-9.el8.x86_64",
"Installed: annobin-8.90-1.el8.x86_64",
"Installed: systemtap-4.2-6.el8.x86_64",
"Installed: byacc-1.9.20170709-4.el8.x86_64",
"Installed: systemtap-devel-4.2-6.el8.x86_64",
"Installed: ltrace-0.7.91-28.el8.x86_64",
"Installed: ctags-5.8-22.el8.x86_64",
"Installed: bison-3.0.4-10.el8.x86_64"
]
}
[root@workstation ~]# ansible localhost -a "dnf group list"
[WARNING]: Consider using the dnf module rather than running 'dnf'. If you
need to use command because dnf is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of
this message.
localhost | CHANGED | rc=0 >>
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 1:19:18 ago on Sat 07 Oct 2023 11:50:32 PM EDT.
Available Environment Groups:
Server with GUI
Server
Minimal Install
Custom Operating System
Virtualization Host
Installed Environment Groups:
Workstation
Installed Groups:
Development Tools
Available Groups:
Legacy UNIX Compatibility
Container Management
.NET Core Development
Graphical Administration Tools
Headless Management
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
[root@workstation ~]#
Hi khokha,
Do not see a problem you mentioned. Both version of syntax are working:
[root@workstation ~]# ansible localhost -m dnf -a "name='@Development tools' state=present"
localhost | CHANGED => {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Group development installed.",
"Installed: autoconf-2.69-27.el8.noarch",
"Installed: diffstat-1.61-7.el8.x86_64",
hi Shura,
when i run ansible all -m command -a "dnf group list" for the first time when i installed "@Development Tools" it wasn't listed in installed group but when i changed name to "@RPM Development Tools" and run ansible all command again i found RPM Development Tools in installed groups.
So, i'm wondering if they're not the same thing and why only RPM Development Tools is listed but not Development Tools?
Thanks
Hi khokha,
Could not reproduce your case:
[root@workstation ~]# ansible localhost -m dnf -a "name='@Development tools' state=absent"
localhost | CHANGED => {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Removed: flex-2.6.1-9.el8.x86_64",
"Removed: ltrace-0.7.91-28.el8.x86_64",
"Removed: jna-4.5.1-5.el8.x86_64",
"Removed: perl-Fedora-VSP-0.001-9.el8.noarch",
"Removed: ctags-5.8-22.el8.x86_64",
"Removed: gcc-8.3.1-5.el8.x86_64",
"Removed: gcc-c++-8.3.1-5.el8.x86_64",
"Removed: gcc-gdb-plugin-8.3.1-5.el8.x86_64",
"Removed: make-1:4.2.1-10.el8.x86_64",
"Removed: gdb-8.2-11.el8.x86_64",
"Removed: annobin-8.90-1.el8.x86_64",
"Removed: perl-generators-1.10-9.el8.noarch",
"Removed: asciidoc-8.6.10-0.5.20180627gitf7c2274.el8.noarch",
"Removed: systemtap-4.2-6.el8.x86_64",
"Removed: systemtap-devel-4.2-6.el8.x86_64",
"Removed: pesign-0.112-25.el8.x86_64",
"Removed: libtool-2.4.6-25.el8.x86_64",
"Removed: glibc-devel-2.28-101.el8.x86_64",
"Removed: autoconf-2.69-27.el8.noarch",
"Removed: diffstat-1.61-7.el8.x86_64",
"Removed: automake-1.16.1-6.el8.noarch",
"Removed: redhat-rpm-config-122-1.el8.noarch",
"Removed: bison-3.0.4-10.el8.x86_64",
"Removed: rpm-build-4.14.2-37.el8.x86_64",
"Removed: rpm-sign-4.14.2-37.el8.x86_64",
"Removed: intltool-0.51.0-11.el8.noarch",
"Removed: byacc-1.9.20170709-4.el8.x86_64",
"Removed: libxcrypt-devel-4.1.1-4.el8.x86_64",
"Removed: valgrind-1:3.15.0-11.el8.x86_64",
"Removed: valgrind-devel-1:3.15.0-11.el8.x86_64",
"Removed: patchutils-0.3.4-10.el8.x86_64",
"Removed: source-highlight-3.1.8-16.el8.x86_64"
]
}
[root@workstation ~]# ansible localhost -m dnf -a "name='@RPM Development tools' state=absent"
localhost | SUCCESS => {
"changed": false,
"msg": "Nothing to do",
"rc": 0,
"results": []
}
[root@workstation ~]# ansible localhost -m dnf -a "name='@Development tools' state=present"
localhost | CHANGED => {
"changed": true,
"msg": "",
"rc": 0,
"results": [
"Group development installed.",
"Installed: libxcrypt-devel-4.1.1-4.el8.x86_64",
"Installed: patchutils-0.3.4-10.el8.x86_64",
"Installed: asciidoc-8.6.10-0.5.20180627gitf7c2274.el8.noarch",
"Installed: gcc-8.3.1-5.el8.x86_64",
"Installed: gcc-c++-8.3.1-5.el8.x86_64",
"Installed: gcc-gdb-plugin-8.3.1-5.el8.x86_64",
"Installed: redhat-rpm-config-122-1.el8.noarch",
"Installed: source-highlight-3.1.8-16.el8.x86_64",
"Installed: glibc-devel-2.28-101.el8.x86_64",
"Installed: libtool-2.4.6-25.el8.x86_64",
"Installed: autoconf-2.69-27.el8.noarch",
"Installed: diffstat-1.61-7.el8.x86_64",
"Installed: jna-4.5.1-5.el8.x86_64",
"Installed: perl-generators-1.10-9.el8.noarch",
"Installed: rpm-sign-4.14.2-37.el8.x86_64",
"Installed: rpm-build-4.14.2-37.el8.x86_64",
"Installed: valgrind-1:3.15.0-11.el8.x86_64",
"Installed: valgrind-devel-1:3.15.0-11.el8.x86_64",
"Installed: make-1:4.2.1-10.el8.x86_64",
"Installed: automake-1.16.1-6.el8.noarch",
"Installed: pesign-0.112-25.el8.x86_64",
"Installed: intltool-0.51.0-11.el8.noarch",
"Installed: gdb-8.2-11.el8.x86_64",
"Installed: perl-Fedora-VSP-0.001-9.el8.noarch",
"Installed: flex-2.6.1-9.el8.x86_64",
"Installed: annobin-8.90-1.el8.x86_64",
"Installed: systemtap-4.2-6.el8.x86_64",
"Installed: byacc-1.9.20170709-4.el8.x86_64",
"Installed: systemtap-devel-4.2-6.el8.x86_64",
"Installed: ltrace-0.7.91-28.el8.x86_64",
"Installed: ctags-5.8-22.el8.x86_64",
"Installed: bison-3.0.4-10.el8.x86_64"
]
}
[root@workstation ~]# ansible localhost -a "dnf group list"
[WARNING]: Consider using the dnf module rather than running 'dnf'. If you
need to use command because dnf is insufficient you can add 'warn: false' to
this command task or set 'command_warnings=False' in ansible.cfg to get rid of
this message.
localhost | CHANGED | rc=0 >>
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 1:19:18 ago on Sat 07 Oct 2023 11:50:32 PM EDT.
Available Environment Groups:
Server with GUI
Server
Minimal Install
Custom Operating System
Virtualization Host
Installed Environment Groups:
Workstation
Installed Groups:
Development Tools
Available Groups:
Legacy UNIX Compatibility
Container Management
.NET Core Development
Graphical Administration Tools
Headless Management
Network Servers
RPM Development Tools
Scientific Support
Security Tools
Smart Card Support
System Tools
[root@workstation ~]#
Thanks for your reply.
So, i should use "@Development Tools" in the playbook to install the group.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.