kolla-ansible/ansible/roles/etcd/tasks/lookup_cluster.yml
Jan Gutter ed3b27cc92 etcd: Add support for more scenarios
This commit addresses a few shortcomings in the etcd service:
  * Adding or removing etcd nodes required manual intervention.

  * The etcd service would have brief outages during upgrades or
    reconfigures because restarts weren't always serialised.

This makes the etcd service follow a similar pattern to mariadb:
  * There is now a distiction between bootstrapping the cluster
    and adding / removing another member.

  * This more closely follows etcd's upstream bootstrapping
    guidelines.

  * The etcd role now serialises restarts internally so the
    kolla_serial pattern is no longer appropriate (or necessary).

This does not remove the need for manual intervention in all
failure modes: the documentation has been updated to address the
most common issues.

Note that there's repetition in the container specifications: this
is somewhat deliberate. In a future cleanup, it's intended to reduce
the duplication.

Change-Id: I39829ba0c5894f8e549f9b83b416e6db4fafd96f
2023-11-28 18:43:56 +01:00

27 lines
867 B
YAML

---
- name: Ensure etcd volume
become: true
kolla_container:
action: "create_volume"
common_options: "{{ docker_common_options }}"
name: "kolla_etcd"
register: etcd_volume
# NOTE(jan.gutter): If the play is interrupted before properly bootstrapping,
# we will incorrectly assume that an etcd cluster exists. This likely requires
# manual intervention to unwedge. If a volume exists we must assume there's
# data on it.
- name: Divide hosts by their etcd volume availability
group_by:
key: etcd_had_volume_{{ etcd_volume is not changed }}
changed_when: false
- name: Establish whether the cluster has already existed
set_fact:
etcd_cluster_exists: "{{ groups.etcd_had_volume_True is defined }}"
changed_when:
- etcd_remove_deleted_members | bool
- groups.etcd_had_volume_True is defined
notify: Check for deleted members