summaryrefslogtreecommitdiffstats
path: root/roles/openshift_node/tasks
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2017-02-21 15:03:45 +0100
committerGiuseppe Scrivano <gscrivan@redhat.com>2017-02-28 13:56:03 +0100
commitabc495780e8fafe699b10399c8ac9c5d9dde73a6 (patch)
tree39575a923878c93293170384c4e67811d83cbeea /roles/openshift_node/tasks
parent61ac568ce8586b03bd025a83c052dcf5b677c885 (diff)
downloadopenshift-abc495780e8fafe699b10399c8ac9c5d9dde73a6.tar.gz
openshift-abc495780e8fafe699b10399c8ac9c5d9dde73a6.tar.bz2
openshift-abc495780e8fafe699b10399c8ac9c5d9dde73a6.tar.xz
openshift-abc495780e8fafe699b10399c8ac9c5d9dde73a6.zip
node: use the new oc_atomic_container module
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'roles/openshift_node/tasks')
-rw-r--r--roles/openshift_node/tasks/node_system_container.yml38
-rw-r--r--roles/openshift_node/tasks/openvswitch_system_container.yml38
2 files changed, 18 insertions, 58 deletions
diff --git a/roles/openshift_node/tasks/node_system_container.yml b/roles/openshift_node/tasks/node_system_container.yml
index 3ae5c7600..abe139418 100644
--- a/roles/openshift_node/tasks/node_system_container.yml
+++ b/roles/openshift_node/tasks/node_system_container.yml
@@ -1,36 +1,16 @@
---
+- name: Load lib_openshift modules
+ include_role:
+ name: lib_openshift
+
- name: Pre-pull node system container image
command: >
atomic pull --storage=ostree {{ openshift.common.system_images_registry }}/{{ openshift.node.node_system_image }}:{{ openshift_image_tag }}
register: pull_result
changed_when: "'Pulling layer' in pull_result.stdout"
-- name: Check Node system container package
- command: >
- atomic containers list --no-trunc -a -f container={{ openshift.common.service_type }}-node
- register: result
-
-- name: Update Node system container package
- command: >
- atomic containers update {{ openshift.common.service_type }}-node
- register: update_result
- changed_when: "'Extracting' in update_result.stdout"
- when:
- - 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:
- - not l_is_same_version
- - ("node" in result.stdout)
-
-- name: Install Node system container package
- command: >
- atomic install --system --name={{ openshift.common.service_type }}-node {{ openshift.common.system_images_registry }}/{{ openshift.node.node_system_image }}:{{ openshift_image_tag }}
- register: install_node_result
- changed_when: "'Extracting' in pull_result.stdout"
- when:
- - not l_is_same_version or ("node" not in result.stdout) | bool
+- name: Install or Update node system container
+ oc_atomic_container:
+ name: "{{ openshift.common.service_type }}-node"
+ image: "{{ openshift.common.system_images_registry }}/{{ openshift.node.node_system_image }}:{{ openshift_image_tag }}"
+ state: latest
diff --git a/roles/openshift_node/tasks/openvswitch_system_container.yml b/roles/openshift_node/tasks/openvswitch_system_container.yml
index 6114230d0..b76ce8797 100644
--- a/roles/openshift_node/tasks/openvswitch_system_container.yml
+++ b/roles/openshift_node/tasks/openvswitch_system_container.yml
@@ -1,36 +1,16 @@
---
+- name: Load lib_openshift modules
+ include_role:
+ name: lib_openshift
+
- name: Pre-pull OpenVSwitch system container image
command: >
atomic pull --storage=ostree {{ openshift.common.system_images_registry }}/{{ openshift.node.ovs_system_image }}:{{ openshift_image_tag }}
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
-
-- name: Update OpenvSwitch system container package
- command: >
- atomic containers update openvswitch
- register: update_result
- changed_when: "'Extracting' in update_result.stdout"
- when:
- - l_is_same_version
- - ("openvswitch" in result.stdout) | bool
-
-- name: Uninstall OpenvSwitch system container package
- command: >
- atomic uninstall openvswitch
- failed_when: False
- when:
- - 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:
- - not l_is_same_version or ("openvswitch" not in result.stdout) | bool
- notify:
- - restart docker
+- name: Install or Update OpenVSwitch system container
+ oc_atomic_container:
+ name: openvswitch
+ image: "{{ openshift.common.system_images_registry }}/{{ openshift.node.ovs_system_image }}:{{ openshift_image_tag }}"
+ state: latest