diff options
author | Giuseppe Scrivano <gscrivano@gnu.org> | 2017-02-28 17:19:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-28 17:19:34 +0100 |
commit | bfe7e99d9a09f06f021f73dfd2631e28dc3983b0 (patch) | |
tree | 2fb645db8d90405a092b3069a284e92eaf67e9d2 /roles/openshift_master | |
parent | c4a6dadabab826a98163efa229136f87d3944053 (diff) | |
parent | abc495780e8fafe699b10399c8ac9c5d9dde73a6 (diff) | |
download | openshift-bfe7e99d9a09f06f021f73dfd2631e28dc3983b0.tar.gz openshift-bfe7e99d9a09f06f021f73dfd2631e28dc3983b0.tar.bz2 openshift-bfe7e99d9a09f06f021f73dfd2631e28dc3983b0.tar.xz openshift-bfe7e99d9a09f06f021f73dfd2631e28dc3983b0.zip |
Merge pull request #3434 from giuseppe/system-containers-module
System containers module
Diffstat (limited to 'roles/openshift_master')
-rw-r--r-- | roles/openshift_master/tasks/system_container.yml | 79 | ||||
-rw-r--r-- | roles/openshift_master/vars/main.yml | 1 |
2 files changed, 23 insertions, 57 deletions
diff --git a/roles/openshift_master/tasks/system_container.yml b/roles/openshift_master/tasks/system_container.yml index a0e1ac75e..1b3e0dba1 100644 --- a/roles/openshift_master/tasks/system_container.yml +++ b/roles/openshift_master/tasks/system_container.yml @@ -1,4 +1,8 @@ --- +- name: Load lib_openshift modules + include_role: + name: lib_openshift + - name: Pre-pull master system container image command: > atomic pull --storage=ostree {{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }} @@ -10,68 +14,31 @@ 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) - - l_is_same_version - - not l_is_ha - -- name: Uninstall Master system container package - command: > - atomic uninstall {{ openshift.common.service_type }}-master - failed_when: False - when: - - ("master" in result.stdout) - - not l_is_same_version - - not l_is_ha - -- 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 }} +- name: Install or Update master system container + oc_atomic_container: + name: "{{ openshift.common.service_type }}-master" + image: "{{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }}" + state: latest when: - - not l_is_same_version or ("master" not in result.stdout) | bool - not l_is_ha - notify: - - restart master # HA -- name: Update Master HA system container package - command: > - atomic containers update {{ openshift.common.service_type }}-master-{{ item }} - register: update_result - changed_when: "'Extracting' in update_result.stdout" - with_items: - - api - - controllers - when: - - ("master" in result.stdout) - - l_is_same_version - - l_is_ha - -- name: Uninstall Master HA system container package - command: > - atomic uninstall {{ openshift.common.service_type }}-master-{{ item }} - failed_when: False - with_items: - - api - - controllers +- name: Install or Update HA api master system container + oc_atomic_container: + name: "{{ openshift.common.service_type }}-master-api" + image: "{{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }}" + state: latest + values: + - COMMAND=api when: - - ("master" in result.stdout) - - not l_is_same_version - l_is_ha -- name: Install Master HA system container package - command: > - atomic install --system --set COMMAND={{ item }} --name={{ openshift.common.service_type }}-master-{{ item }} {{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }} - with_items: - - api - - controllers +- name: Install or Update HA controller master system container + oc_atomic_container: + name: "{{ openshift.common.service_type }}-master-controllers" + image: "{{ openshift.common.system_images_registry }}/{{ openshift.master.master_system_image }}:{{ openshift_image_tag }}" + state: latest + values: + - COMMAND=controllers when: - - not l_is_same_version or ("master" not in result.stdout) | bool - l_is_ha - notify: - - restart master diff --git a/roles/openshift_master/vars/main.yml b/roles/openshift_master/vars/main.yml index 1e157097d..c5ba20409 100644 --- a/roles/openshift_master/vars/main.yml +++ b/roles/openshift_master/vars/main.yml @@ -20,4 +20,3 @@ openshift_master_valid_grant_methods: - deny l_is_ha: "{{ openshift.master.ha is defined and openshift.master.ha | bool }}" -l_is_same_version: "{{ (openshift.common.version is defined) and (openshift.common.version == openshift_version) | bool }}" |