I am trying to convert this yum command to Ansible task:
yum -y install yum-plugin-copr
yum -y copr enable @spacewalkproject/nightly-client
created task like this, but giving error.
- name: Install repository yum-plugin-copr
yum:
name: "{{ packages }}"
vars:
packages:
- yum-plugin-copr
- name: Install repository Spacewalk-Client
yum:
name: copr
enablerepo: "@spacewalkproject/nightly-client"
state: present
Error:
Error setting/accessing repos: Error getting repository data for @spacewalkproject/nightly-client, repository not found
What is the right way to convert this command to Ansible task?
Thanks SR
The
yummodule is meant to install, remove, update and list Yum packages. It doesn't support sub-commands from plugins like YUM Copr Plugin. Therefore, you can't expect to callyum coprsub-command by using this module.There is an opened issue to add support to Copr in
dnfmodule, you should take a look and subscribe to the discussion.Meanwhile, you could try to add the repository with
yum_repositorymodule, or simply callyum coprwith theshellmodule.