Pārlūkot izejas kodu

set initial etcd cluster properly during system container scale up

Jan Chaloupka 7 gadi atpakaļ
vecāks
revīzija
641be9236e

+ 1 - 1
playbooks/common/openshift-etcd/scaleup.yml

@@ -46,7 +46,7 @@
     etcd_ca_host: "{{ groups.oo_etcd_to_config.0 }}"
     etcd_certificates_etcd_hosts: "{{ groups.oo_etcd_to_config | default([], true) }}"
     etcd_initial_cluster_state: "existing"
-    initial_etcd_cluster: "{{ etcd_add_check.stdout_lines[3] | regex_replace('ETCD_INITIAL_CLUSTER=','') | regex_replace('\"','') }}"
+    etcd_initial_cluster: "{{ etcd_add_check.stdout_lines[3] | regex_replace('ETCD_INITIAL_CLUSTER=','') | regex_replace('\"','') }}"
     etcd_ca_setup: False
     r_etcd_common_etcd_runtime: "{{ openshift.common.etcd_runtime }}"
   - role: nickhammond.logrotate

+ 1 - 0
roles/etcd/tasks/system_container.yml

@@ -17,6 +17,7 @@
       {{ hostvars[host].etcd_hostname }}={{ etcd_peer_url_scheme }}://{{ hostvars[host].etcd_ip }}:{{ etcd_peer_port }},
       {%- endif -%}
       {% endfor -%}
+  when: etcd_initial_cluster is undefined
 
 - name: Check etcd system container package
   command: >

+ 2 - 2
roles/etcd/templates/etcd.conf.j2

@@ -29,8 +29,8 @@ ETCD_INITIAL_CLUSTER={{ etcd_hostname}}={{ etcd_initial_advertise_peer_urls }}
 ETCD_INITIAL_CLUSTER_STATE={{ etcd_initial_cluster_state }}
 ETCD_INITIAL_CLUSTER_TOKEN=thirdparty-etcd-cluster-1
 {% else %}
-{% if initial_etcd_cluster is defined and initial_etcd_cluster %}
-ETCD_INITIAL_CLUSTER={{ initial_etcd_cluster }}
+{% if etcd_initial_cluster is defined and etcd_initial_cluster %}
+ETCD_INITIAL_CLUSTER={{ etcd_initial_cluster }}
 {% else %}
 ETCD_INITIAL_CLUSTER={{ initial_cluster() }}
 {% endif %}