mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2025-12-14 22:04:43 +03:00
This reverts commit 4209f1cbfd.
This commit is contained in:
@@ -21,8 +21,6 @@
|
|||||||
- name: wait for etcd up
|
- name: wait for etcd up
|
||||||
uri:
|
uri:
|
||||||
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
|
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2379/health"
|
||||||
client_cert: "{{ etcd_cert_dir}}/admin-{{ groups['etcd'][0] }}.pem"
|
|
||||||
client_key: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}-key.pem"
|
|
||||||
validate_certs: no
|
validate_certs: no
|
||||||
register: result
|
register: result
|
||||||
until: result.status is defined and result.status == 200
|
until: result.status is defined and result.status == 200
|
||||||
|
|||||||
@@ -5,11 +5,12 @@
|
|||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
changed_when: false
|
changed_when: false
|
||||||
check_mode: no
|
check_mode: no
|
||||||
|
when: is_etcd_master
|
||||||
tags:
|
tags:
|
||||||
- facts
|
- facts
|
||||||
|
|
||||||
- name: Configure | Add member to the cluster if it is not there
|
- name: Configure | Add member to the cluster if it is not there
|
||||||
when: etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0
|
when: is_etcd_master and etcd_member_in_cluster.rc != 0 and etcd_cluster_is_healthy.rc == 0
|
||||||
shell: "{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} member add {{ etcd_member_name }} {{ etcd_peer_url }}"
|
shell: "{{ bin_dir }}/etcdctl --peers={{ etcd_access_addresses }} member add {{ etcd_member_name }} {{ etcd_peer_url }}"
|
||||||
|
|
||||||
- name: Install etcd launch script
|
- name: Install etcd launch script
|
||||||
@@ -26,13 +27,5 @@
|
|||||||
src: "etcd-{{ etcd_deployment_type }}.service.j2"
|
src: "etcd-{{ etcd_deployment_type }}.service.j2"
|
||||||
dest: /etc/systemd/system/etcd.service
|
dest: /etc/systemd/system/etcd.service
|
||||||
backup: yes
|
backup: yes
|
||||||
|
when: is_etcd_master
|
||||||
notify: restart etcd
|
notify: restart etcd
|
||||||
|
|
||||||
- name: Confugure | Set etcd data dir permissions
|
|
||||||
file:
|
|
||||||
path: "{{ etcd_data_dir }}"
|
|
||||||
owner: etcd
|
|
||||||
group: etcd
|
|
||||||
mode: 0700
|
|
||||||
state: directory
|
|
||||||
recurse: yes
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
ETCD_DATA_DIR={{ etcd_data_dir }}
|
ETCD_DATA_DIR={{ etcd_data_dir }}
|
||||||
ETCD_WAL_DIR={{ etcd_data_dir }}/member/wal
|
|
||||||
ETCD_ADVERTISE_CLIENT_URLS={{ etcd_client_url }}
|
ETCD_ADVERTISE_CLIENT_URLS={{ etcd_client_url }}
|
||||||
ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_peer_url }}
|
ETCD_INITIAL_ADVERTISE_PEER_URLS={{ etcd_peer_url }}
|
||||||
ETCD_INITIAL_CLUSTER_STATE={% if etcd_cluster_is_healthy.rc != 0 | bool %}new{% else %}existing{% endif %}
|
ETCD_INITIAL_CLUSTER_STATE={% if etcd_cluster_is_healthy.rc != 0 | bool %}new{% else %}existing{% endif %}
|
||||||
@@ -23,5 +22,3 @@ ETCD_PEER_TRUSTED_CA_FILE={{ etcd_cert_dir }}/ca.pem
|
|||||||
ETCD_PEER_CERT_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem
|
ETCD_PEER_CERT_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}.pem
|
||||||
ETCD_PEER_KEY_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem
|
ETCD_PEER_KEY_FILE={{ etcd_cert_dir }}/member-{{ inventory_hostname }}-key.pem
|
||||||
ETCD_PEER_CLIENT_CERT_AUTH=true
|
ETCD_PEER_CLIENT_CERT_AUTH=true
|
||||||
ETCD_CLIENT_CERT_AUTH=true
|
|
||||||
|
|
||||||
|
|||||||
@@ -81,8 +81,6 @@
|
|||||||
- name: Calico | wait for etcd
|
- name: Calico | wait for etcd
|
||||||
uri:
|
uri:
|
||||||
url: https://localhost:2379/health
|
url: https://localhost:2379/health
|
||||||
client_cert: "{{ etcd_cert_dir}}/admin-{{ groups['etcd'][0] }}.pem"
|
|
||||||
client_key: "{{ etcd_cert_dir }}/admin-{{ groups['etcd'][0] }}-key.pem"
|
|
||||||
validate_certs: no
|
validate_certs: no
|
||||||
register: result
|
register: result
|
||||||
until: result.status == 200 or result.status == 401
|
until: result.status == 200 or result.status == 401
|
||||||
|
|||||||
Reference in New Issue
Block a user