Browse Source

Add fedora compatibility

- don't check pkg versions on Fedora, it won't work; they move
  faster than RHEL and it's not realistic to maintain that package
  list.
- handle differences between yum and dnf pkgspec for excluder
- work-around for a bug in dnf
  https://bugzilla.redhat.com/show_bug.cgi?id=1199432
- make requirement verify one play, don't run unnecessary checks on
  Fedora
Adam Miller 7 years ago
parent
commit
bd1c0f820f

+ 11 - 2
playbooks/common/openshift-cluster/config.yml

@@ -1,14 +1,17 @@
 ---
 # TODO: refactor this into its own include
 # and pass a variable for ctx
-- name: Verify Requirements
+- name: Verify Install Requirements
   hosts: oo_all_hosts
   roles:
   - openshift_health_checker
   vars:
   - r_openshift_health_checker_playbook_context: install
   post_tasks:
-  - action: openshift_health_check
+
+  - name: Verify Requirements - EL
+    when: ansible_distribution != "Fedora"
+    action: openshift_health_check
     args:
       checks:
       - disk_availability
@@ -17,6 +20,12 @@
       - package_version
       - docker_image_availability
       - docker_storage
+  - name: Verify Requirements - Fedora
+    when: ansible_distribution == "Fedora"
+    action: openshift_health_check
+    args:
+      checks:
+      - docker_image_availability
 
 - include: ../openshift-etcd/config.yml
 

+ 29 - 2
roles/openshift_excluder/tasks/install.yml

@@ -6,19 +6,46 @@
 
   block:
 
-  - name: Install docker excluder
+  - name: Install docker excluder - yum
     package:
       name: "{{ r_openshift_excluder_service_type }}-docker-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) +  '*' }}"
       state: "{{ r_openshift_excluder_docker_package_state }}"
     when:
     - r_openshift_excluder_enable_docker_excluder | bool
+    - ansible_pkg_mgr == "yum"
 
-  - name: Install openshift excluder
+
+  # For DNF we do not need the "*" and if we add it, it causes an error because
+  # it's not a valid pkg_spec
+  #
+  # https://bugzilla.redhat.com/show_bug.cgi?id=1199432
+  - name: Install docker excluder - dnf
+    package:
+      name: "{{ r_openshift_excluder_service_type }}-docker-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
+      state: "{{ r_openshift_excluder_docker_package_state }}"
+    when:
+    - r_openshift_excluder_enable_docker_excluder | bool
+    - ansible_pkg_mgr == "dnf"
+
+  - name: Install openshift excluder - yum
     package:
       name: "{{ r_openshift_excluder_service_type }}-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) + '*' }}"
       state: "{{ r_openshift_excluder_package_state }}"
     when:
     - r_openshift_excluder_enable_openshift_excluder | bool
+    - ansible_pkg_mgr == "yum"
+
+  # For DNF we do not need the "*" and if we add it, it causes an error because
+  # it's not a valid pkg_spec
+  #
+  # https://bugzilla.redhat.com/show_bug.cgi?id=1199432
+  - name: Install openshift excluder - dnf
+    package:
+      name: "{{ r_openshift_excluder_service_type }}-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) }}"
+      state: "{{ r_openshift_excluder_package_state }}"
+    when:
+    - r_openshift_excluder_enable_openshift_excluder | bool
+    - ansible_pkg_mgr == "dnf"
 
   - set_fact:
       r_openshift_excluder_install_ran: True