summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivano@gnu.org>2017-02-10 16:01:46 +0100
committerGitHub <noreply@github.com>2017-02-10 16:01:46 +0100
commite1e69ad8346a6938e1d58a852dbf2f8ad28eff6f (patch)
tree8cabded134f0423b6d61cf95f00a574539d00db7 /roles/openshift_master
parent07ca54fe406a533e70350aa9273d5a3df297f156 (diff)
parentb84a2cdcbdcbceed8da09485a9e9015378b5818f (diff)
downloadopenshift-e1e69ad8346a6938e1d58a852dbf2f8ad28eff6f.tar.gz
openshift-e1e69ad8346a6938e1d58a852dbf2f8ad28eff6f.tar.bz2
openshift-e1e69ad8346a6938e1d58a852dbf2f8ad28eff6f.tar.xz
openshift-e1e69ad8346a6938e1d58a852dbf2f8ad28eff6f.zip
Merge pull request #3109 from giuseppe/system-containers
System containers
Diffstat (limited to 'roles/openshift_master')
-rw-r--r--roles/openshift_master/tasks/main.yml4
-rw-r--r--roles/openshift_master/tasks/system_container.yml36
-rw-r--r--roles/openshift_master/tasks/systemd_units.yml6
3 files changed, 43 insertions, 3 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 9cd6b6c81..2ef61cddf 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -131,6 +131,10 @@
- name: Install the systemd units
include: systemd_units.yml
+- name: Install Master system container
+ include: system_container.yml
+ when: openshift.common.is_containerized | bool and openshift.common.is_master_system_container | bool
+
- name: Create session secrets file
template:
dest: "{{ openshift.master.session_secrets_file }}"
diff --git a/roles/openshift_master/tasks/system_container.yml b/roles/openshift_master/tasks/system_container.yml
new file mode 100644
index 000000000..e3e3d7948
--- /dev/null
+++ b/roles/openshift_master/tasks/system_container.yml
@@ -0,0 +1,36 @@
+---
+- 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 }}
+ 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:
+ - ("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 is not defined) or (openshift.common.version != openshift_version) or ("master" not in result.stdout) | bool
+ notify:
+ - restart master
diff --git a/roles/openshift_master/tasks/systemd_units.yml b/roles/openshift_master/tasks/systemd_units.yml
index 39ea42ab3..4ab98cbbb 100644
--- a/roles/openshift_master/tasks/systemd_units.yml
+++ b/roles/openshift_master/tasks/systemd_units.yml
@@ -20,14 +20,14 @@
docker pull {{ openshift.master.master_image }}:{{ openshift_image_tag }}
register: pull_result
changed_when: "'Downloaded newer image' in pull_result.stdout"
- when: openshift.common.is_containerized | bool
+ when: openshift.common.is_containerized | bool and not openshift.common.is_master_system_container | bool
# workaround for missing systemd unit files
- name: Create the systemd unit files
template:
src: "master_docker/master.docker.service.j2"
dest: "{{ containerized_svc_dir }}/{{ openshift.common.service_type }}-master.service"
- when: openshift.common.is_containerized | bool and (openshift.master.ha is not defined or not openshift.master.ha | bool)
+ when: openshift.common.is_containerized | bool and (openshift.master.ha is not defined or not openshift.master.ha | bool and not openshift.common.is_master_system_container | bool)
register: create_master_unit_file
- command: systemctl daemon-reload
@@ -132,7 +132,7 @@
dest: "/etc/systemd/system/{{ openshift.common.service_type }}-master.service"
src: master_docker/master.docker.service.j2
register: install_result
- when: openshift.common.is_containerized | bool and openshift.master.ha is defined and not openshift.master.ha | bool
+ when: openshift.common.is_containerized | bool and openshift.master.ha is defined and not openshift.master.ha | bool and not openshift.common.is_master_system_container | bool
- name: Preserve Master Proxy Config options
command: grep PROXY /etc/sysconfig/{{ openshift.common.service_type }}-master