|
@@ -1,84 +0,0 @@
|
|
|
----
|
|
|
-- name: Determine if excluder packages are installed
|
|
|
- rpm_q:
|
|
|
- name: "{{ openshift.common.service_type }}-excluder"
|
|
|
- state: present
|
|
|
- register: openshift_excluder_installed
|
|
|
- failed_when: false
|
|
|
-
|
|
|
-# docker excluder needs to be enable by default
|
|
|
-- name: Determine if docker packages are installed
|
|
|
- rpm_q:
|
|
|
- name: "{{ openshift.common.service_type }}-docker-excluder"
|
|
|
- state: present
|
|
|
- register: docker_excluder_installed
|
|
|
- failed_when: false
|
|
|
-
|
|
|
-# The excluder status function returns 0 when everything is excluded
|
|
|
-# and 1 if any packages are missing from the exclusions list and outputs a warning to stderr
|
|
|
-# # atomic-openshift-excluder status ; echo $?
|
|
|
-# exclude -- All packages excluded
|
|
|
-# 0
|
|
|
-# # atomic-openshift-excluder unexclude
|
|
|
-# # atomic-openshift-excluder status ; echo $?
|
|
|
-# unexclude -- At least one package not excluded
|
|
|
-# 1
|
|
|
-
|
|
|
-- block:
|
|
|
- - include: init.yml
|
|
|
- - block:
|
|
|
- - name: Record openshift excluder status
|
|
|
- command: "{{ openshift.common.service_type }}-excluder status"
|
|
|
- register: excluder_status
|
|
|
- failed_when: false
|
|
|
-
|
|
|
- # Even though the openshift excluder is enabled
|
|
|
- # if the status is non-zero, disabled the excluder
|
|
|
- - name: Override openshift excluder enablement if the status is non-zero
|
|
|
- set_fact:
|
|
|
- disable_openshift_excluder_override: true
|
|
|
- when:
|
|
|
- - "{{ excluder_status.rc | default(0) != 0 }}"
|
|
|
-
|
|
|
- - debug:
|
|
|
- msg: "Disabling openshift excluder"
|
|
|
- when:
|
|
|
- - "{{ excluder_status.rc | default(0) != 0 }}"
|
|
|
-
|
|
|
- when:
|
|
|
- - "{{ openshift_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
- - "{{ openshift_excluder_on }}"
|
|
|
-
|
|
|
- - block:
|
|
|
- - name: Record docker excluder status
|
|
|
- command: "{{ openshift.common.service_type }}-docker-excluder status"
|
|
|
- register: docker_excluder_status
|
|
|
- failed_when: false
|
|
|
-
|
|
|
- # If the docker excluder is installed and the status is non-zero
|
|
|
- # always enable the docker excluder
|
|
|
- - name: Override docker excluder enablement if the status is non-zero
|
|
|
- set_fact:
|
|
|
- enable_docker_excluder_override: true
|
|
|
- when:
|
|
|
- - "{{ docker_excluder_status.rc | default(0) != 0 }}"
|
|
|
-
|
|
|
- - debug:
|
|
|
- msg: "Enabling docker excluder"
|
|
|
- when:
|
|
|
- - "{{ docker_excluder_status.rc | default(0) != 0 }}"
|
|
|
-
|
|
|
- # As the docker excluder status is not satisfied,
|
|
|
- # re-enable entire docker excluder again
|
|
|
- # At the same time keep the override set in a case other task would
|
|
|
- - name: Enable docker excluder
|
|
|
- command: "{{ openshift.common.service_type }}-docker-excluder exclude"
|
|
|
-
|
|
|
- # Run the docker excluder status even if the excluder is disabled.
|
|
|
- # In order to determine of the excluder needs to be enabled.
|
|
|
- when:
|
|
|
- - "{{ docker_excluder_installed.installed_versions | default([]) | length > 0 }}"
|
|
|
- - "{{ docker_excluder_on }}"
|
|
|
-
|
|
|
- when:
|
|
|
- - not openshift.common.is_atomic | bool
|