summaryrefslogtreecommitdiffstats
path: root/roles/openshift_master/tasks/main.yml
diff options
context:
space:
mode:
Diffstat (limited to 'roles/openshift_master/tasks/main.yml')
-rw-r--r--roles/openshift_master/tasks/main.yml94
1 files changed, 8 insertions, 86 deletions
diff --git a/roles/openshift_master/tasks/main.yml b/roles/openshift_master/tasks/main.yml
index 82b4b420c..b6d3539b1 100644
--- a/roles/openshift_master/tasks/main.yml
+++ b/roles/openshift_master/tasks/main.yml
@@ -18,12 +18,6 @@
- openshift.master.ha | bool
- (openshift.master.cluster_method is not defined) or (openshift.master.cluster_method is defined and openshift.master.cluster_method not in ["native", "pacemaker"])
- fail:
- msg: "'native' high availability is not supported for the requested OpenShift version"
- when:
- - openshift.master.ha | bool
- - openshift.master.cluster_method == "native"
- - not openshift.common.version_gte_3_1_or_1_1 | bool
-- fail:
msg: "openshift_master_cluster_password must be set for multi-master installations"
when:
- openshift.master.ha | bool
@@ -177,31 +171,12 @@
local_facts:
no_proxy_etcd_host_ips: "{{ openshift_no_proxy_etcd_host_ips }}"
+- name: Update journald config
+ include: journald.yml
+
- name: Install the systemd units
include: systemd_units.yml
-- name: Checking for journald.conf
- stat: path=/etc/systemd/journald.conf
- register: journald_conf_file
-
-- name: Update journald setup
- replace:
- dest: /etc/systemd/journald.conf
- regexp: '^(\#| )?{{ item.var }}=\s*.*?$'
- replace: ' {{ item.var }}={{ item.val }}'
- backup: yes
- with_items: "{{ journald_vars_to_replace | default([]) }}"
- when: journald_conf_file.stat.exists
- register: journald_update
-
-# I need to restart journald immediatelly, otherwise it gets into way during
-# further steps in ansible
-- name: Restart journald
- systemd:
- name: systemd-journald
- state: restarted
- when: journald_update | changed
-
- name: Install Master system container
include: system_container.yml
when:
@@ -237,23 +212,10 @@
- restart master api
- restart master controllers
-- name: modify controller args
- yedit:
- src: /etc/origin/master/master-config.yaml
- edits:
- - key: kubernetesMasterConfig.controllerArguments.cluster-signing-cert-file
- value:
- - /etc/origin/master/ca.crt
- - key: kubernetesMasterConfig.controllerArguments.cluster-signing-key-file
- value:
- - /etc/origin/master/ca.key
- notify:
- - restart master controllers
+- include: bootstrap_settings.yml
when: openshift_master_bootstrap_enabled | default(False)
- include: set_loopback_context.yml
- when:
- - openshift.common.version_gte_3_2_or_1_2
- name: Start and enable master api on first master
systemd:
@@ -311,59 +273,18 @@
# A separate wait is required here for native HA since notifies will
# be resolved after all tasks in the role.
-- name: Wait for API to become available
- # Using curl here since the uri module requires python-httplib2 and
- # wait_for port doesn't provide health information.
- command: >
- curl --silent --tlsv1.2
- {% if openshift.common.version_gte_3_2_or_1_2 | bool %}
- --cacert {{ openshift.common.config_base }}/master/ca-bundle.crt
- {% else %}
- --cacert {{ openshift.common.config_base }}/master/ca.crt
- {% endif %}
- {{ openshift.master.api_url }}/healthz/ready
- register: l_api_available_output
- until: l_api_available_output.stdout == 'ok'
- retries: 120
- delay: 1
- run_once: true
- changed_when: false
+- include: check_master_api_is_ready.yml
when:
- openshift.master.cluster_method == 'native'
- master_api_service_status_changed | bool
-- name: Start and enable master controller on first master
- systemd:
- name: "{{ openshift.common.service_type }}-master-controllers"
- enabled: yes
- state: started
- when:
- - openshift.master.cluster_method == 'native'
- - inventory_hostname == openshift_master_hosts[0]
- register: l_start_result
- until: not l_start_result | failed
- retries: 1
- delay: 60
-
-- name: Dump logs from master-controllers if it failed
- command: journalctl --no-pager -n 100 -u {{ openshift.common.service_type }}-master-controllers
- when:
- - l_start_result | failed
-
-- name: Wait for master controller service to start on first master
- pause:
- seconds: 15
- when:
- - openshift.master.cluster_method == 'native'
-
-- name: Start and enable master controller on all masters
+- name: Start and enable master controller service
systemd:
name: "{{ openshift.common.service_type }}-master-controllers"
enabled: yes
state: started
when:
- openshift.master.cluster_method == 'native'
- - inventory_hostname != openshift_master_hosts[0]
register: l_start_result
until: not l_start_result | failed
retries: 1
@@ -374,7 +295,8 @@
when:
- l_start_result | failed
-- set_fact:
+- name: Set fact master_controllers_service_status_changed
+ set_fact:
master_controllers_service_status_changed: "{{ l_start_result | changed }}"
when:
- openshift.master.cluster_method == 'native'