summaryrefslogtreecommitdiffstats
path: root/roles/openshift_excluder/tasks
diff options
context:
space:
mode:
authorOpenShift Bot <eparis+openshiftbot@redhat.com>2017-03-20 20:14:42 -0500
committerGitHub <noreply@github.com>2017-03-20 20:14:42 -0500
commit8f9adf4a895b1f33a8c9ae734483c428c10e8b15 (patch)
tree70fbd12d06546a264ee2912133a28fc729a34d58 /roles/openshift_excluder/tasks
parent03ae7f76debd812264b6831a6f3314825b251abe (diff)
parent0dc62b7550980a0627cb15796be3746f6a924a7d (diff)
downloadopenshift-8f9adf4a895b1f33a8c9ae734483c428c10e8b15.tar.gz
openshift-8f9adf4a895b1f33a8c9ae734483c428c10e8b15.tar.bz2
openshift-8f9adf4a895b1f33a8c9ae734483c428c10e8b15.tar.xz
openshift-8f9adf4a895b1f33a8c9ae734483c428c10e8b15.zip
Merge pull request #3715 from sdodson/excluders-v99
Merged by openshift-bot
Diffstat (limited to 'roles/openshift_excluder/tasks')
-rw-r--r--roles/openshift_excluder/tasks/adjust.yml25
-rw-r--r--roles/openshift_excluder/tasks/disable.yml24
-rw-r--r--roles/openshift_excluder/tasks/enable.yml9
-rw-r--r--roles/openshift_excluder/tasks/exclude.yml14
-rw-r--r--roles/openshift_excluder/tasks/install.yml4
-rw-r--r--roles/openshift_excluder/tasks/unexclude.yml11
6 files changed, 49 insertions, 38 deletions
diff --git a/roles/openshift_excluder/tasks/adjust.yml b/roles/openshift_excluder/tasks/adjust.yml
deleted file mode 100644
index cbdd7785b..000000000
--- a/roles/openshift_excluder/tasks/adjust.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-# Depending on enablement of individual excluders and their status
-# some excluders needs to be disabled, resp. enabled
-# By default, all excluders are disabled unless overrided.
-- block:
- - include: init.yml
- # All excluders that are to be enabled are enabled
- - include: exclude.yml
- vars:
- # Enable the docker excluder only if it is overrided
- # BZ #1430612: docker excluders should be enabled even during installation and upgrade
- exclude_docker_excluder: "{{ enable_docker_excluder | default(true) | bool }}"
- # excluder is to be disabled by default
- exclude_openshift_excluder: false
- # All excluders that are to be disabled are disabled
- - include: unexclude.yml
- vars:
- # If the docker override is not set, default to the generic behaviour
- # BZ #1430612: docker excluders should be enabled even during installation and upgrade
- unexclude_docker_excluder: false
- # disable openshift excluder is never overrided to be enabled
- # disable it if the docker excluder is enabled
- unexclude_openshift_excluder: "{{ openshift_excluder_on | bool }}"
- when:
- - not openshift.common.is_atomic | bool
diff --git a/roles/openshift_excluder/tasks/disable.yml b/roles/openshift_excluder/tasks/disable.yml
index 2245c7b21..e23496b3b 100644
--- a/roles/openshift_excluder/tasks/disable.yml
+++ b/roles/openshift_excluder/tasks/disable.yml
@@ -1,7 +1,6 @@
---
# input variables
# - with_status_check
-# - with_install
# - excluder_package_state
# - docker_excluder_package_state
- include: init.yml
@@ -18,5 +17,24 @@
# it the docker excluder is enabled, we install it and in case its status is non-zero
# it is enabled no matter what
- # And finally adjust an excluder in order to update host components correctly
-- include: adjust.yml
+# And finally adjust an excluder in order to update host components correctly. First
+# exclude then unexclude
+- block:
+ - include: exclude.yml
+ vars:
+ # Enable the docker excluder only if it is overrided
+ # BZ #1430612: docker excluders should be enabled even during installation and upgrade
+ exclude_docker_excluder: "{{ docker_excluder_on | bool }}"
+ # excluder is to be disabled by default
+ exclude_openshift_excluder: false
+ # All excluders that are to be disabled are disabled
+ - include: unexclude.yml
+ vars:
+ # If the docker override is not set, default to the generic behaviour
+ # BZ #1430612: docker excluders should be enabled even during installation and upgrade
+ unexclude_docker_excluder: false
+ # disable openshift excluder is never overrided to be enabled
+ # disable it if the docker excluder is enabled
+ unexclude_openshift_excluder: true
+ when:
+ - not openshift.common.is_atomic | bool
diff --git a/roles/openshift_excluder/tasks/enable.yml b/roles/openshift_excluder/tasks/enable.yml
index 9122c9aeb..e719325bc 100644
--- a/roles/openshift_excluder/tasks/enable.yml
+++ b/roles/openshift_excluder/tasks/enable.yml
@@ -1,6 +1,5 @@
---
# input variables:
-# - with_install
- block:
- include: init.yml
@@ -8,14 +7,12 @@
vars:
install_docker_excluder: "{{ docker_excluder_on | bool }}"
install_openshift_excluder: "{{ openshift_excluder_on | bool }}"
- when: with_install | default(docker_excluder_on or openshift_excluder_on) | bool
+ when: docker_excluder_on or openshift_excluder_on | bool
- include: exclude.yml
vars:
- # Enable the docker excluder only if it is overrided, resp. enabled by default (in that order)
- exclude_docker_excluder: "{{ enable_docker_excluder_override | default(docker_excluder_on) | bool }}"
- # Enable the openshift excluder only if it is not overrided, resp. enabled by default (in that order)
- exclude_openshift_excluder: "{{ not disable_openshift_excluder_override | default(not openshift_excluder_on) | bool }}"
+ exclude_docker_excluder: "{{ docker_excluder_on | bool }}"
+ exclude_openshift_excluder: "{{ openshift_excluder_on | bool }}"
when:
- not openshift.common.is_atomic | bool
diff --git a/roles/openshift_excluder/tasks/exclude.yml b/roles/openshift_excluder/tasks/exclude.yml
index d31351aea..ca18d343f 100644
--- a/roles/openshift_excluder/tasks/exclude.yml
+++ b/roles/openshift_excluder/tasks/exclude.yml
@@ -3,18 +3,28 @@
# - exclude_docker_excluder
# - exclude_openshift_excluder
- block:
+
+ - name: Check for docker-excluder
+ stat:
+ path: /sbin/{{ openshift.common.service_type }}-docker-excluder
+ register: docker_excluder_stat
- name: Enable docker excluder
command: "{{ openshift.common.service_type }}-docker-excluder exclude"
- # if the docker override is set, it means the docker excluder needs to be enabled no matter what
- # if the docker override is not set, the excluder is set based on enable_docker_excluder
when:
- exclude_docker_excluder | default(false) | bool
+ - docker_excluder_stat.stat.exists
+ - name: Check for openshift excluder
+ stat:
+ path: /sbin/{{ openshift.common.service_type }}-excluder
+ register: openshift_excluder_stat
- name: Enable openshift excluder
command: "{{ openshift.common.service_type }}-excluder exclude"
# if the openshift override is set, it means the openshift excluder is disabled no matter what
# if the openshift override is not set, the excluder is set based on enable_openshift_excluder
when:
- exclude_openshift_excluder | default(false) | bool
+ - openshift_excluder_stat.stat.exists
+
when:
- not openshift.common.is_atomic | bool
diff --git a/roles/openshift_excluder/tasks/install.yml b/roles/openshift_excluder/tasks/install.yml
index dcc8df0cb..3490a613e 100644
--- a/roles/openshift_excluder/tasks/install.yml
+++ b/roles/openshift_excluder/tasks/install.yml
@@ -6,14 +6,14 @@
- name: Install docker excluder
package:
- name: "{{ openshift.common.service_type }}-docker-excluder"
+ name: "{{ openshift.common.service_type }}-docker-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) + '*' }}"
state: "{{ docker_excluder_package_state }}"
when:
- install_docker_excluder | default(true) | bool
- name: Install openshift excluder
package:
- name: "{{ openshift.common.service_type }}-excluder"
+ name: "{{ openshift.common.service_type }}-excluder{{ openshift_pkg_version | default('') | oo_image_tag_to_rpm_version(include_dash=True) + '*' }}"
state: "{{ openshift_excluder_package_state }}"
when:
- install_openshift_excluder | default(true) | bool
diff --git a/roles/openshift_excluder/tasks/unexclude.yml b/roles/openshift_excluder/tasks/unexclude.yml
index 9112adbac..4df7f14b4 100644
--- a/roles/openshift_excluder/tasks/unexclude.yml
+++ b/roles/openshift_excluder/tasks/unexclude.yml
@@ -3,15 +3,26 @@
# - unexclude_docker_excluder
# - unexclude_openshift_excluder
- block:
+
+ - name: Check for docker-excluder
+ stat:
+ path: /sbin/{{ openshift.common.service_type }}-docker-excluder
+ register: docker_excluder_stat
- name: disable docker excluder
command: "{{ openshift.common.service_type }}-docker-excluder unexclude"
when:
- unexclude_docker_excluder | default(false) | bool
+ - docker_excluder_stat.stat.exists
+ - name: Check for openshift excluder
+ stat:
+ path: /sbin/{{ openshift.common.service_type }}-excluder
+ register: openshift_excluder_stat
- name: disable openshift excluder
command: "{{ openshift.common.service_type }}-excluder unexclude"
when:
- unexclude_openshift_excluder | default(false) | bool
+ - openshift_excluder_stat.stat.exists
when:
- not openshift.common.is_atomic | bool