Skip to content

Commit 2321691

Browse files
authored
Merge pull request #205 from Rendanic/prolpublicyum
common: Skip downloading public-yum.repo on newer OL7 versions
2 parents 9c6bb7e + 90c6def commit 2321691

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

roles/common/tasks/main.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,22 @@
2424
tags:
2525
- epelrepo
2626

27+
# Do not use the old public-yum.repo on OL7 after January 2019 anymore
28+
# Check for /usr/bin/ol_yum_configure.sh in newer systems
29+
- name: Check for ol_yum_configure.sh
30+
stat:
31+
path: /usr/bin/ol_yum_configure.sh
32+
register: olyumconfigfile
33+
when: configure_public_yum_repo and ansible_distribution == 'OracleLinux'
34+
tags:
35+
- olrepo
36+
37+
# Update public-yum.repo only on old versions of OL7
2738
- name: Get newest repo-file for OL (public-yum)
2839
get_url: dest={{ repo_dir}}/{{ ol_repo_file }} url=http://public-yum.oracle.com/{{ ol_repo_file }} backup=yes
29-
when: configure_public_yum_repo and ansible_distribution == 'OracleLinux'
40+
when: not olyumconfigfile.stat.exists | default(false) and configure_public_yum_repo and ansible_distribution == 'OracleLinux'
3041
tags:
31-
- ol6repo
42+
- olrepo
3243

3344
- name: Install common packages OL/RHEL
3445
yum: name={{ common_packages }} state=installed

0 commit comments

Comments
 (0)