Parameter
Customize etcd with the 13-parameter
There are 13 parameters about the ETCD module.
ETCD: 10 Parameters:
| Parameter | Type | Level | Comment |
|---|---|---|---|
etcd_seq | int | I | etcd instance identifier, REQUIRED |
etcd_cluster | string | C | etcd cluster & group name, etcd by default |
etcd_learner | bool | I | prevent purging running etcd instance? |
etcd_data | path | C | etcd data directory, /data/etcd by default |
etcd_port | port | C | etcd client port, 2379 by default |
etcd_peer_port | port | C | etcd peer port, 2380 by default |
etcd_init | enum | C | etcd initial cluster state, new or existing |
etcd_election_timeout | int | C | etcd election timeout, 1000ms by default |
etcd_heartbeat_interval | int | C | etcd heartbeat interval, 100ms by default |
ETCD_REMOVE: 3 Parameters:
| Parameter | Type | Level | Comment |
|---|---|---|---|
etcd_safeguard | bool | G/C/A | prevent purging running etcd instance? |
etcd_rm_data | bool | G/C/A | remove etcd data during removal? (default: true) |
etcd_rm_pkg | bool | G/C/A | uninstall etcd packages during removal? (default: false) |
Defaults
The default parameters are defined in roles/etcd/defaults/main.yml
Additional removal parameters are defined in roles/etcd_remove/defaults/main.yml
#-----------------------------------------------------------------
# ETCD
#-----------------------------------------------------------------
#etcd_seq: 1 # etcd instance identifier, explicitly required
etcd_cluster: etcd # etcd cluster & group name, etcd by default
etcd_data: /data/etcd # etcd data directory, /data/etcd by default
etcd_learner: false # etcd instance run as learner? false by default
etcd_port: 2379 # etcd client port, 2379 by default
etcd_peer_port: 2380 # etcd peer port, 2380 by default
etcd_init: new # etcd initial cluster state, new or existing
etcd_election_timeout: 1000 # etcd election timeout, 1000ms by default
etcd_heartbeat_interval: 100 # etcd heartbeat interval, 100ms by defaultETCD_REMOVE Parameters
#-----------------------------------------------------------------
# ETCD_REMOVE
#-----------------------------------------------------------------
etcd_safeguard: false # prevent accidental removal?
etcd_rm_data: true # remove etcd data during removal?
etcd_rm_pkg: false # uninstall etcd packages during removal?etcd_seq
name: etcd_seq, type: int, level: I
etcd instance identifier, REQUIRED
no default value, you have to specify it explicitly. Here is a 3-node etcd cluster example:
etcd: # dcs service for postgres/patroni ha consensus
hosts: # 1 node for testing, 3 or 5 for production
10.10.10.10: { etcd_seq: 1 } # etcd_seq required
10.10.10.11: { etcd_seq: 2 } # assign from 1 ~ n
10.10.10.12: { etcd_seq: 3 } # use odd numbers
vars: # cluster level parameter override roles/etcd
etcd_cluster: etcd # mark etcd cluster name etcd
etcd_safeguard: false # safeguard against purging
etcd_clean: true # purge etcd during init processetcd_cluster
name: etcd_cluster, type: string, level: C
etcd cluster & group name, etcd by default
default values: etcd, which is a fixed group name, can be useful when you want to use deployed some extra etcd clusters
etcd_learner
name: etcd_learner, type: bool, level: I
Init etcd instance as learner? default value is false
When set to true, the etcd instance will be init as leaner, so it will not be able to vote in the etcd cluster.
You can promote it to a full member later with etcdctl member promote command.
etcd_data
name: etcd_data, type: path, level: C
etcd data directory, /data/etcd by default
etcd_port
name: etcd_port, type: port, level: C
etcd client port, 2379 by default
etcd_peer_port
name: etcd_peer_port, type: port, level: C
etcd peer port, 2380 by default
etcd_init
name: etcd_init, type: enum, level: C
etcd initial cluster state, new or existing
default values: new, which will create a standalone new etcd cluster.
The value existing is used when trying to append new member to existing etcd cluster.
etcd_election_timeout
name: etcd_election_timeout, type: int, level: C
etcd election timeout, 1000 (ms) by default
etcd_heartbeat_interval
name: etcd_heartbeat_interval, type: int, level: C
etcd heartbeat interval, 100 (ms) by default
ETCD_REMOVE
This section contains parameters for the etcd_remove role,
which are action flags for the etcd-rm.yml playbook.
etcd_safeguard
name: etcd_safeguard, type: bool, level: G/C/A
prevent purging etcd instance? default value is false
If enabled, running etcd instance will not be purged by etcd-rm.yml playbook.
etcd_rm_data
name: etcd_rm_data, type: bool, level: G/C/A
remove etcd data during removal? default value is true
When enabled, the etcd-rm.yml playbook will remove etcd data directories and configuration files during cluster or member removal.
etcd_rm_pkg
name: etcd_rm_pkg, type: bool, level: G/C/A
uninstall etcd packages during removal? default value is false
When enabled, the etcd-rm.yml playbook will uninstall etcd packages during cluster or member removal.