summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2017-02-12 19:34:45 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2017-02-14 15:57:58 +0100
commite63ff886e7d52470bfc7d8baab2b24766759c166 (patch)
treefdd63df300fc3bf63cc732f1df4f25045de8919f /roles/openshift_node
parent95cf33d8b8e9bfeffbf1cc80bf55fc3c603be190 (diff)
downloadopenshift-e63ff886e7d52470bfc7d8baab2b24766759c166.tar.gz
openshift-e63ff886e7d52470bfc7d8baab2b24766759c166.tar.bz2
openshift-e63ff886e7d52470bfc7d8baab2b24766759c166.tar.xz
openshift-e63ff886e7d52470bfc7d8baab2b24766759c166.zip
node, vars/main.yml: define l_is_ha and l_is_same_version
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'roles/openshift_node')
-rw-r--r--roles/openshift_node/tasks/node_system_container.yml11
-rw-r--r--roles/openshift_node/tasks/openvswitch_system_container.yml7
-rw-r--r--roles/openshift_node/vars/main.yml2
3 files changed, 10 insertions, 10 deletions
diff --git a/roles/openshift_node/tasks/node_system_container.yml b/roles/openshift_node/tasks/node_system_container.yml
index bb1f4a4dd..3ae5c7600 100644
--- a/roles/openshift_node/tasks/node_system_container.yml
+++ b/roles/openshift_node/tasks/node_system_container.yml
@@ -16,17 +16,16 @@
register: update_result
changed_when: "'Extracting' in update_result.stdout"
when:
- - openshift.common.version is defined
- - openshift.common.version == openshift_version
- - ("node" in result.stdout) | bool
+ - l_is_same_version
+ - ("node" in result.stdout)
- name: Uninstall Node system container package
command: >
atomic uninstall {{ openshift.common.service_type }}-node
failed_when: False
when:
- - (openshift.common.version is not defined) or (openshift.common.version != openshift_version)
- - ("node" in result.stdout) | bool
+ - not l_is_same_version
+ - ("node" in result.stdout)
- name: Install Node system container package
command: >
@@ -34,4 +33,4 @@
register: install_node_result
changed_when: "'Extracting' in pull_result.stdout"
when:
- - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) or ("node" not in result.stdout) | bool
+ - not l_is_same_version or ("node" not in result.stdout) | bool
diff --git a/roles/openshift_node/tasks/openvswitch_system_container.yml b/roles/openshift_node/tasks/openvswitch_system_container.yml
index 69d028b92..6114230d0 100644
--- a/roles/openshift_node/tasks/openvswitch_system_container.yml
+++ b/roles/openshift_node/tasks/openvswitch_system_container.yml
@@ -16,8 +16,7 @@
register: update_result
changed_when: "'Extracting' in update_result.stdout"
when:
- - openshift.common.version is defined
- - openshift.common.version == openshift_version
+ - l_is_same_version
- ("openvswitch" in result.stdout) | bool
- name: Uninstall OpenvSwitch system container package
@@ -25,13 +24,13 @@
atomic uninstall openvswitch
failed_when: False
when:
- - (openshift.common.version is not defined) or (openshift.common.version != openshift_version)
+ - not l_is_same_version
- ("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 is not defined) or (openshift.common.version != openshift_version) or ("openvswitch" not in result.stdout) | bool
+ - not l_is_same_version or ("openvswitch" not in result.stdout) | bool
notify:
- restart docker
diff --git a/roles/openshift_node/vars/main.yml b/roles/openshift_node/vars/main.yml
new file mode 100644
index 000000000..0c2abf3b9
--- /dev/null
+++ b/roles/openshift_node/vars/main.yml
@@ -0,0 +1,2 @@
+---
+l_is_same_version: "{{ (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool }}"