crb_repo: Initial version

This commit is contained in:
Timo Makinen 2023-07-21 10:31:52 +00:00
parent 0011b6184c
commit 0fce25a2dd

21
crb_repo/tasks/main.yml Normal file
View file

@ -0,0 +1,21 @@
---
- name: Check if repository is enabled
ansible.builtin.command:
argv:
- dnf
- config-manager
- --dump
- crb
changed_when: false
register: result
- name: Enable repository
ansible.builtin.command:
argv:
- dnf
- config-manager
- --set-enabled
- crb
register: result
changed_when: result.rc == 0
when: "'enabled = 1' not in result.stdout_lines"