From daa54ed6ced6aac872f9712c17eb0be97b3fe59b Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 18 Jan 2017 14:01:26 +0100 Subject: system-containers: implement idempotent update Upstream version has "atomic containers update ..." but the RHEL version is still using "atomic update --container" so stick with this for now. Signed-off-by: Giuseppe Scrivano --- roles/openshift_master/tasks/system_container.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'roles/openshift_master') diff --git a/roles/openshift_master/tasks/system_container.yml b/roles/openshift_master/tasks/system_container.yml index 25c179e71..e3e3d7948 100644 --- a/roles/openshift_master/tasks/system_container.yml +++ b/roles/openshift_master/tasks/system_container.yml @@ -5,13 +5,32 @@ register: pull_result changed_when: "'Pulling layer' in pull_result.stdout" +- name: Check Master system container package + command: > + atomic containers list --no-trunc -a -f container={{ openshift.common.service_type }}-master + register: result + +- name: Update Master system container package + command: > + atomic containers update {{ openshift.common.service_type }}-master + register: update_result + changed_when: "'Extracting' in update_result.stdout" + when: + - ("master" in result.stdout) + - (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool + - name: Uninstall Master system container package command: > atomic uninstall {{ openshift.common.service_type }}-master failed_when: False - when: openshift.common.version != openshift_version + when: + - ("master" in result.stdout) + - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) | bool - name: Install Master system container package command: > atomic install --system --name={{ openshift.common.service_type }}-master {{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }} - when: openshift.common.version != openshift_version + when: + - (openshift.common.version is not defined) or (openshift.common.version != openshift_version) or ("master" not in result.stdout) | bool + notify: + - restart master -- cgit v1.2.3