summaryrefslogtreecommitdiffstats
path: root/roles/openshift_repos
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-12-09 16:44:55 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2015-12-09 16:44:55 -0500
commitec7b8b68b6467e17487ec4c81fbe2c6826e3c889 (patch)
treecba54e9138630742d0788a5cff9f70ec75b93032 /roles/openshift_repos
parentecae1fcaaf6d83f2fb6dce0624990b2d13c25db9 (diff)
parentb1d30491f1581503003646684137bf2c218660ba (diff)
downloadopenshift-ec7b8b68b6467e17487ec4c81fbe2c6826e3c889.tar.gz
openshift-ec7b8b68b6467e17487ec4c81fbe2c6826e3c889.tar.bz2
openshift-ec7b8b68b6467e17487ec4c81fbe2c6826e3c889.tar.xz
openshift-ec7b8b68b6467e17487ec4c81fbe2c6826e3c889.zip
Merge pull request #1046 from sdodson/yum-dnf-cleanup
Remove yum / dnf duplication
Diffstat (limited to 'roles/openshift_repos')
-rw-r--r--roles/openshift_repos/handlers/main.yml7
-rw-r--r--roles/openshift_repos/tasks/main.yaml25
2 files changed, 10 insertions, 22 deletions
diff --git a/roles/openshift_repos/handlers/main.yml b/roles/openshift_repos/handlers/main.yml
index fed4ab2f0..198fc7d6e 100644
--- a/roles/openshift_repos/handlers/main.yml
+++ b/roles/openshift_repos/handlers/main.yml
@@ -1,6 +1,3 @@
---
-- name: refresh yum cache
- command: yum clean all
-
-- name: refresh dnf cache
- command: dnf clean all
+- name: refresh cache
+ command: "{{ ansible_pkg_mgr }} clean all"
diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml
index c55b5df89..9faf0dfd9 100644
--- a/roles/openshift_repos/tasks/main.yaml
+++ b/roles/openshift_repos/tasks/main.yaml
@@ -11,30 +11,21 @@
that: openshift.common.deployment_type in known_openshift_deployment_types
- name: Ensure libselinux-python is installed
- yum:
- pkg: libselinux-python
- state: present
- when: ansible_pkg_mgr == "yum"
-
-- name: Ensure libselinux-python is installed
- dnf:
- pkg: libselinux-python
- state: present
- when: ansible_pkg_mgr == "dnf"
+ action: "{{ ansible_pkg_mgr }} name=libselinux-python state=present"
- name: Create any additional repos that are defined
template:
src: yum_repo.j2
dest: /etc/yum.repos.d/openshift_additional.repo
when: openshift_additional_repos | length > 0
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove the additional repos if no longer defined
file:
dest: /etc/yum.repos.d/openshift_additional.repo
state: absent
when: openshift_additional_repos | length == 0
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove any yum repo files for other deployment types RHEL/CentOS
file:
@@ -44,7 +35,7 @@
- '*/repos/*'
when: not (item | search("/files/" ~ openshift_deployment_type ~ "/repos")) and
(ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
- notify: refresh yum cache
+ notify: refresh cache
- name: Remove any yum repo files for other deployment types Fedora
file:
@@ -54,24 +45,24 @@
- '*/repos/*'
when: not (item | search("/files/fedora-" ~ openshift_deployment_type ~ "/repos")) and
(ansible_distribution == "Fedora")
- notify: refresh dnf cache
+ notify: refresh cache
- name: Configure gpg keys if needed
copy: src={{ item }} dest=/etc/pki/rpm-gpg/
with_fileglob:
- "{{ openshift_deployment_type }}/gpg_keys/*"
- notify: refresh yum cache
+ notify: refresh cache
- name: Configure yum repositories RHEL/CentOS
copy: src={{ item }} dest=/etc/yum.repos.d/
with_fileglob:
- "{{ openshift_deployment_type }}/repos/*"
- notify: refresh yum cache
+ notify: refresh cache
when: (ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
- name: Configure yum repositories Fedora
copy: src={{ item }} dest=/etc/yum.repos.d/
with_fileglob:
- "fedora-{{ openshift_deployment_type }}/repos/*"
- notify: refresh dnf cache
+ notify: refresh cache
when: (ansible_distribution == "Fedora")