diff options
-rw-r--r-- | playbooks/common/openshift-cluster/disable_excluder.yml | 2 | ||||
-rw-r--r-- | roles/openshift_excluder/README.md | 2 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/adjust.yml | 25 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/disable.yml | 24 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/enable.yml | 9 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/exclude.yml | 14 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/install.yml | 4 | ||||
-rw-r--r-- | roles/openshift_excluder/tasks/unexclude.yml | 11 |
8 files changed, 50 insertions, 41 deletions
diff --git a/playbooks/common/openshift-cluster/disable_excluder.yml b/playbooks/common/openshift-cluster/disable_excluder.yml index 68bffb5f5..f664c51c9 100644 --- a/playbooks/common/openshift-cluster/disable_excluder.yml +++ b/playbooks/common/openshift-cluster/disable_excluder.yml @@ -1,5 +1,5 @@ --- -- name: Record excluder state and disable +- name: Disable excluders hosts: oo_masters_to_config:oo_nodes_to_config gather_facts: no tasks: diff --git a/roles/openshift_excluder/README.md b/roles/openshift_excluder/README.md index e76a15952..e048bd107 100644 --- a/roles/openshift_excluder/README.md +++ b/roles/openshift_excluder/README.md @@ -18,8 +18,6 @@ Facts | enable_docker_excluder | enable_excluders | Enable docker excluder. If not set, the docker excluder is ignored. | | enable_openshift_excluder | enable_excluders | Enable openshift excluder. If not set, the openshift excluder is ignored. | | enable_excluders | None | Enable all excluders -| enable_docker_excluder_override | None | indication the docker excluder needs to be enabled | -| disable_openshift_excluder_override | None | indication the openshift excluder needs to be disabled | Role Variables -------------- 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 |