Fix add repositories in RedHat and Suse

These tasks should be used with become like Debian.yaml, otherwise
error will occurred like this:
[Errno 13] Permission denied: '/etc/yum.repos.d/test.repo'

Change-Id: I9c6f0132536500d36ba0098b635b1858e05d7ccf
This commit is contained in:
Xing Zhang 2020-07-21 10:39:07 +08:00
parent 9e20909819
commit 1242a98137
No known key found for this signature in database
GPG Key ID: 43F80E57B910E3B0
2 changed files with 2 additions and 0 deletions

View File

@ -30,6 +30,7 @@
path: '{{ gpg_key_tempdir.path }}'
- name: Add repositories
become: true
yum_repository:
name: "{{ zj_item['name'] }}"
file: "{{ zj_item['file'] | default(zj_item['name']) }}"

View File

@ -30,6 +30,7 @@
path: '{{ gpg_key_tempdir.path }}'
- name: Add repositories
become: true
zypper_repository:
name: "{{ zj_item['name'] }}"
description: "{{ zj_item['description'] | default(omit) }}"