summaryrefslogtreecommitdiffstats
path: root/roles/openshift_repos/tasks/main.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_repos/tasks/main.yaml')
-rw-r--r--roles/openshift_repos/tasks/main.yaml52
1 files changed, 52 insertions, 0 deletions
diff --git a/roles/openshift_repos/tasks/main.yaml b/roles/openshift_repos/tasks/main.yaml
new file mode 100644
index 000000000..d41245093
--- /dev/null
+++ b/roles/openshift_repos/tasks/main.yaml
@@ -0,0 +1,52 @@
+---
+- name: openshift_repos detect ostree
+ stat:
+ path: /run/ostree-booted
+ register: ostree_booted
+
+- when: not ostree_booted.stat.exists
+ block:
+ # TODO: This needs to be removed and placed into a role
+ - name: Ensure libselinux-python is installed
+ package: name=libselinux-python state=present
+
+ - name: Create any additional repos that are defined
+ yum_repository:
+ description: "{{ item.description | default(item.name | default(item.id)) }}"
+ name: "{{ item.name | default(item.id) }}"
+ baseurl: "{{ item.baseurl }}"
+ gpgkey: "{{ item.gpgkey | default(omit)}}"
+ gpgcheck: "{{ item.gpgcheck | default(1) }}"
+ sslverify: "{{ item.sslverify | default(1) }}"
+ sslclientkey: "{{ item.sslclientkey | default(omit) }}"
+ sslclientcert: "{{ item.sslclientcert | default(omit) }}"
+ file: "{{ item.name }}"
+ enabled: "{{ item.enabled | default('no')}}"
+ with_items: "{{ openshift_additional_repos }}"
+ when: openshift_additional_repos | length > 0
+ notify: refresh cache
+
+ # Singleton block
+ - when: r_openshift_repos_has_run is not defined
+ block:
+
+ - include: centos_repos.yml
+ when:
+ - ansible_os_family == "RedHat"
+ - ansible_distribution != "Fedora"
+ - openshift_deployment_type == 'origin'
+ - openshift_enable_origin_repo | default(true) | bool
+
+ - name: Ensure clean repo cache in the event repos have been changed manually
+ debug:
+ msg: "First run of openshift_repos"
+ changed_when: true
+ notify: refresh cache
+
+ - name: Record that openshift_repos already ran
+ set_fact:
+ r_openshift_repos_has_run: True
+
+ # Force running ALL handlers now, because we expect repo cache to be cleared
+ # if changes have been made.
+ - meta: flush_handlers