Przeglądaj źródła

Simplify excluder enablement logic a bit more

Scott Dodson 8 lat temu
rodzic
commit
4b0fa927ae

+ 0 - 2
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
 --------------

+ 2 - 2
roles/openshift_excluder/tasks/adjust.yml

@@ -9,7 +9,7 @@
     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 }}"
+      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
@@ -20,6 +20,6 @@
       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 }}"
+      unexclude_openshift_excluder: true
   when:
   - not openshift.common.is_atomic | bool

+ 0 - 1
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

+ 3 - 6
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

+ 0 - 2
roles/openshift_excluder/tasks/exclude.yml

@@ -5,8 +5,6 @@
 - block:
   - 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