summaryrefslogtreecommitdiffstats
path: root/playbooks/common/openshift-etcd
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@redhat.com>2015-12-04 09:32:40 -0400
committerDevan Goodwin <dgoodwin@redhat.com>2015-12-11 09:46:48 -0400
commitbee65e693b56a89e709d2125e08bcddb13310c9f (patch)
tree246f1dcb1f46b133489e0b502420265ea71d75db /playbooks/common/openshift-etcd
parent056309be29f86c4250273b6afb191e541b089986 (diff)
downloadopenshift-bee65e693b56a89e709d2125e08bcddb13310c9f.tar.gz
openshift-bee65e693b56a89e709d2125e08bcddb13310c9f.tar.bz2
openshift-bee65e693b56a89e709d2125e08bcddb13310c9f.tar.xz
openshift-bee65e693b56a89e709d2125e08bcddb13310c9f.zip
Bring first etcd server up before others.
In faster environments (i.e. all local VMs) etcd nodes could come online at roughly the same time leading to conflicts with self-elections, resulting in a non-functional cluster. To solve we configure the first etcd host by itself, then configure the remaining ones in parallel to keep things as fast as possible.
Diffstat (limited to 'playbooks/common/openshift-etcd')
-rw-r--r--playbooks/common/openshift-etcd/config.yml28
1 files changed, 26 insertions, 2 deletions
diff --git a/playbooks/common/openshift-etcd/config.yml b/playbooks/common/openshift-etcd/config.yml
index 7d94ced2e..3d7a884e8 100644
--- a/playbooks/common/openshift-etcd/config.yml
+++ b/playbooks/common/openshift-etcd/config.yml
@@ -68,8 +68,32 @@
validate_checksum: yes
with_items: etcd_needing_server_certs
-- name: Configure etcd hosts
- hosts: oo_etcd_to_config
+# Configure a first etcd host to avoid conflicts in choosing a leader
+# if other members come online too quickly.
+- name: Configure first etcd host
+ hosts: oo_first_etcd
+ vars:
+ sync_tmpdir: "{{ hostvars.localhost.g_etcd_mktemp.stdout }}"
+ etcd_url_scheme: https
+ etcd_peer_url_scheme: https
+ etcd_peers_group: oo_etcd_to_config
+ pre_tasks:
+ - name: Ensure certificate directory exists
+ file:
+ path: "{{ etcd_cert_config_dir }}"
+ state: directory
+ - name: Unarchive the tarball on the etcd host
+ unarchive:
+ src: "{{ sync_tmpdir }}/{{ etcd_cert_subdir }}.tgz"
+ dest: "{{ etcd_cert_config_dir }}"
+ when: etcd_server_certs_missing
+ roles:
+ - etcd
+ - role: nickhammond.logrotate
+
+# Configure the remaining etcd hosts, skipping the first one we dealt with above.
+- name: Configure remaining etcd hosts
+ hosts: oo_etcd_to_config:!oo_first_etcd
vars:
sync_tmpdir: "{{ hostvars.localhost.g_etcd_mktemp.stdout }}"
etcd_url_scheme: https