mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 13:46:59 +01:00
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
---
|
|
- name: etcd replicated and outiside of kubeadm when multimasters
|
|
block:
|
|
|
|
- name: Install python3-pip
|
|
apt:
|
|
name: python3-pip
|
|
state: latest
|
|
register: result
|
|
retries: 3
|
|
until: result is success
|
|
|
|
- name: Install docker-compose
|
|
pip:
|
|
name: docker-compose
|
|
|
|
- name: Running etcd container on masters nodes
|
|
docker_container:
|
|
name: etcd
|
|
image: "quay.io/coreos/etcd:v{{etcd_version}}"
|
|
state: started
|
|
detach: True
|
|
ports:
|
|
- "0.0.0.0:2380:2380"
|
|
- "0.0.0.0:2379:2379"
|
|
command: [
|
|
"etcd",
|
|
"--name {{ etcd_name }}",
|
|
"--initial-advertise-peer-urls {{ etcd_initial_advertise_peer_urls }}",
|
|
"--listen-peer-urls {{ etcd_listen_peer_urls }}",
|
|
"--advertise-client-urls {{ etcd_advertise_client_urls }}",
|
|
"--listen-client-urls {{ etcd_listen_client_urls }}",
|
|
"--initial-cluster {{ etcd_initial_cluster }}",
|
|
"--initial-cluster-state {{ etcd_initial_cluster_state }}",
|
|
"--initial-cluster-token {{ etcd_initial_cluster_token }}"
|
|
]
|
|
network_mode: host
|
|
restart_policy: always
|
|
|
|
when:
|
|
- groups.k8s_masters|length > 1
|
|
|