summaryrefslogtreecommitdiffstats
path: root/roles/openshift_repos
diff options
context:
space:
mode:
authorThomas Wiest <twiest@users.noreply.github.com>2015-12-09 15:49:48 -0500
committerThomas Wiest <twiest@users.noreply.github.com>2015-12-09 15:49:48 -0500
commiteeb164fae0e6721100c4fcc1717d92bb85b9652c (patch)
tree70eee046db8012061c178ab4e686650048265564 /roles/openshift_repos
parent898290cb3aabbc9d98883181877ac857a2fe1faf (diff)
parent14c69ad397be8ee101ef5b4edfa223d703e67ad0 (diff)
downloadopenshift-eeb164fae0e6721100c4fcc1717d92bb85b9652c.tar.gz
openshift-eeb164fae0e6721100c4fcc1717d92bb85b9652c.tar.bz2
openshift-eeb164fae0e6721100c4fcc1717d92bb85b9652c.tar.xz
openshift-eeb164fae0e6721100c4fcc1717d92bb85b9652c.zip
Merge pull request #1048 from twiest/prod
Sync master -> Prod
Diffstat (limited to 'roles/openshift_repos')
-rw-r--r--roles/openshift_repos/files/fedora-origin/repos/maxamillion-fedora-openshift-fedora.repo8
-rw-r--r--roles/openshift_repos/handlers/main.yml6
-rw-r--r--roles/openshift_repos/tasks/main.yaml37
3 files changed, 48 insertions, 3 deletions
diff --git a/roles/openshift_repos/files/fedora-origin/repos/maxamillion-fedora-openshift-fedora.repo b/roles/openshift_repos/files/fedora-origin/repos/maxamillion-fedora-openshift-fedora.repo
new file mode 100644
index 000000000..bc0435d82
--- /dev/null
+++ b/roles/openshift_repos/files/fedora-origin/repos/maxamillion-fedora-openshift-fedora.repo
@@ -0,0 +1,8 @@
+[maxamillion-fedora-openshift]
+name=Copr repo for fedora-openshift owned by maxamillion
+baseurl=https://copr-be.cloud.fedoraproject.org/results/maxamillion/fedora-openshift/fedora-$releasever-$basearch/
+skip_if_unavailable=True
+gpgcheck=1
+gpgkey=https://copr-be.cloud.fedoraproject.org/results/maxamillion/fedora-openshift/pubkey.gpg
+enabled=1
+enabled_metadata=1 \ No newline at end of file
diff --git a/roles/openshift_repos/handlers/main.yml b/roles/openshift_repos/handlers/main.yml
new file mode 100644
index 000000000..fed4ab2f0
--- /dev/null
+++ b/roles/openshift_repos/handlers/main.yml
@@ -0,0 +1,6 @@
+---
+- name: refresh yum cache
+ command: yum clean all
+
+- name: refresh dnf cache
+ command: dnf clean all
diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml
index aa696ae12..c55b5df89 100644
--- a/roles/openshift_repos/tasks/main.yaml
+++ b/roles/openshift_repos/tasks/main.yaml
@@ -14,33 +14,64 @@
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"
- 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
- 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
-- name: Remove any yum repo files for other deployment types
+- name: Remove any yum repo files for other deployment types RHEL/CentOS
file:
path: "/etc/yum.repos.d/{{ item | basename }}"
state: absent
with_fileglob:
- '*/repos/*'
- when: not (item | search("/files/" ~ openshift_deployment_type ~ "/repos"))
+ when: not (item | search("/files/" ~ openshift_deployment_type ~ "/repos")) and
+ (ansible_os_family == "RedHat" and ansible_distribution != "Fedora")
+ notify: refresh yum cache
+
+- name: Remove any yum repo files for other deployment types Fedora
+ file:
+ path: "/etc/yum.repos.d/{{ item | basename }}"
+ state: absent
+ with_fileglob:
+ - '*/repos/*'
+ when: not (item | search("/files/fedora-" ~ openshift_deployment_type ~ "/repos")) and
+ (ansible_distribution == "Fedora")
+ notify: refresh dnf 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
-- name: Configure yum repositories
+- name: Configure yum repositories RHEL/CentOS
copy: src={{ item }} dest=/etc/yum.repos.d/
with_fileglob:
- "{{ openshift_deployment_type }}/repos/*"
+ notify: refresh yum 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
+ when: (ansible_distribution == "Fedora")