Yum custom repo creation requires root

We can't assume the executing user is root, so use become.

Also uses a block to perform the RedHat-only check.

Change-Id: Ibf2da6b8086bc8e34b33f113067a213a33213161
Story: 2001898
Task: 14383
This commit is contained in:
Mark Goddard 2018-04-23 15:29:46 +00:00
parent c413033228
commit 6c5f72b550
2 changed files with 6 additions and 7 deletions

View File

@ -25,4 +25,4 @@
retries: 3
delay: 10
until: "'failed' not in register_yum_command"
when: ansible_os_family == 'RedHat'
become: true

View File

@ -1,8 +1,7 @@
---
- block:
- include: redhat.yml
when: yum_use_local_mirror | bool
- include: redhat.yml
when:
- ansible_os_family == "RedHat"
- yum_use_local_mirror
- include: custom_repo.yml
- include: custom_repo.yml
when: ansible_os_family == 'RedHat'