|
@@ -0,0 +1,56 @@
|
|
|
+---
|
|
|
+# Latest versions of the excluders include a status function, old packages dont
|
|
|
+# So, if packages are installed, upgrade them to the latest so we get the status
|
|
|
+# If they're not installed when we should assume they're disabled
|
|
|
+
|
|
|
+- name: Determine if excluder packages are installed
|
|
|
+ rpm_q:
|
|
|
+ name: "{{ openshift.common.service_type }}-excluder"
|
|
|
+ state: present
|
|
|
+ register: openshift_excluder_installed
|
|
|
+ failed_when: false
|
|
|
+
|
|
|
+- name: Determine if docker packages are installed
|
|
|
+ rpm_q:
|
|
|
+ name: "{{ openshift.common.service_type }}-excluder"
|
|
|
+ state: present
|
|
|
+ register: docker_excluder_installed
|
|
|
+ failed_when: false
|
|
|
+
|
|
|
+- name: Update to latest excluder packages
|
|
|
+ package:
|
|
|
+ name: "{{ openshift.common.service_type }}-excluder"
|
|
|
+ when:
|
|
|
+ - "{{ openshift_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
+ - not openshift.common.is_containerized | bool
|
|
|
+
|
|
|
+- name: Update to the latest docker-excluder packages
|
|
|
+ package:
|
|
|
+ name: "{{ openshift.common.service_type }}-docker-excluder"
|
|
|
+ when:
|
|
|
+ - "{{ docker_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
+ - not openshift.common.is_containerized | bool
|
|
|
+
|
|
|
+- name: Record excluder status
|
|
|
+ command: "{{ openshift.common.service_type }}-excluder"
|
|
|
+ register: excluder_status
|
|
|
+ when:
|
|
|
+ - "{{ openshift_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
+ - not openshift.common.is_containerized | bool
|
|
|
+ failed_when: false
|
|
|
+
|
|
|
+- name: Record docker excluder status
|
|
|
+ command: "{{ openshift.common.service_type }}-docker-excluder"
|
|
|
+ register: docker_excluder_status
|
|
|
+ when:
|
|
|
+ - "{{ docker_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
+ - not openshift.common.is_containerized | bool
|
|
|
+ failed_when: false
|
|
|
+
|
|
|
+- name: Set excluder status facts
|
|
|
+ set_fact:
|
|
|
+ docker_excluder_enabled: "{{ 'false' if docker_excluder_status.rc | default(0) == 0 or docker_excluder_installed.installed_versions | default(0) | length == 0 else 'true' }}"
|
|
|
+ openshift_excluder_enabled: "{{ 'false' if docker_excluder_status.rc | default(0) == 0 or openshift_excluder_installed.installed_versions | default(0) | length == 0 else 'true' }}"
|
|
|
+
|
|
|
+- debug: var=docker_excluder_enabled
|
|
|
+- debug: var=openshift_excluder_enabled
|