summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks/openvswitch_system_container.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_node/tasks/openvswitch_system_container.yml')
-rw-r--r--roles/openshift_node/tasks/openvswitch_system_container.yml23
1 files changed, 20 insertions, 3 deletions
diff --git a/roles/openshift_node/tasks/openvswitch_system_container.yml b/roles/openshift_node/tasks/openvswitch_system_container.yml
index 12d62be69..47fac99eb 100644
--- a/roles/openshift_node/tasks/openvswitch_system_container.yml
+++ b/roles/openshift_node/tasks/openvswitch_system_container.yml
@@ -5,15 +5,32 @@
register: pull_result
changed_when: "'Pulling layer' in pull_result.stdout"
+- name: Check OpenvSwitch system container package
+ command: >
+ atomic containers list --no-trunc -a -f container=openvswitch
+ register: result
+ when:
+ - openshift.common.is_openvswitch_system_container | bool
+
+- name: Update OpenvSwitch system container package
+ command: >
+ atomic containers update openvswitch
+ register: update_result
+ changed_when: "'Extracting' in update_result.stdout"
+ when:
+ - (openshift.common.version is defined) and (openshift.common.version == openshift_version) and ("openvswitch" in result.stdout) | bool
+
- name: Uninstall OpenvSwitch system container package
command: >
atomic uninstall openvswitch
failed_when: False
- when: openshift.common.version != openshift_version | bool
+ when:
+ - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) and ("openvswitch" in result.stdout) | bool
- name: Install OpenvSwitch system container package
command: >
atomic install --system --name=openvswitch {{ openshift.common.system_images_registry }}/{{ openshift.node.ovs_system_image }}:{{ openshift_image_tag }}
- when: openshift.common.version != openshift_version | bool
+ when:
+ - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) or ("openvswitch" not in result.stdout) | bool
notify:
- - restart docker
+ - restart docker