powertools: More robust check if repo is enabled

This commit is contained in:
Timo Makinen 2021-09-30 15:04:17 +00:00
parent c156481c50
commit 20634cb959

View file

@ -2,8 +2,10 @@
- name: check if repository is enabled
command:
argv:
- cat
- /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
- dnf
- config-manager
- --dump
- powertools
changed_when: false
register: result
@ -15,4 +17,4 @@
- --set-enabled
- powertools
warn: false
when: "'enabled=1' not in result.stdout_lines"
when: "'enabled = 1' not in result.stdout_lines"