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

60 lines
1.5 KiB
YAML

---
- name: Bootstrap etcd on new cluster
include_tasks: 'bootstrap_cluster.yml'
when:
- kolla_action != "config"
listen:
- Bootstrap etcd cluster
- name: Look up the cluster leader
include_tasks: 'lookup_leader.yml'
when:
- kolla_action != "config"
listen:
- Restart etcd container
- Bootstrap etcd services
- Bootstrap etcd cluster
- Check for deleted members
- name: Bootstrap etcd on new services
include_tasks: 'bootstrap_services.yml'
when:
- groups.etcd_had_volume_False is defined
- inventory_hostname in groups.etcd_had_volume_False
- kolla_action != "config"
listen:
- Bootstrap etcd services
- name: Rolling restart of etcd non-leaders
include_tasks: 'restart_services.yml'
when:
- inventory_hostname not in (groups.etcd_is_leader_True | default([]))
- groups.etcd.index(inventory_hostname) % 4 == item
- kolla_action != "config"
listen:
- Restart etcd container
- Bootstrap etcd services
- Bootstrap etcd cluster
loop:
- 0
- 1
- 2
- 3
- name: Restart etcd leader
include_tasks: 'restart_services.yml'
when:
- inventory_hostname in (groups.etcd_is_leader_True | default([]))
- kolla_action != "config"
listen:
- Restart etcd container
- Bootstrap etcd services
- Bootstrap etcd cluster
- name: Remove deleted members
include_tasks: 'remove_deleted_members.yml'
when:
- kolla_action != "config"
listen:
- Check for deleted members