
Config plays do not need to check containers. This avoids skipping tasks during the genconfig action. Ironic and Glance rolling upgrades are handled specially. Swift and Bifrost do not use the handlers at all. Partially-Implements: blueprint performance-improvements Change-Id: I140bf71d62e8f0932c96270d1f08940a5ba4542a
61 lines
1.7 KiB
YAML
61 lines
1.7 KiB
YAML
---
|
|
# The official procedure for upgrade elasticsearch:
|
|
# https://www.elastic.co/guide/en/elasticsearch/reference/6.x/restart-upgrade.html
|
|
- name: Disable shard allocation
|
|
become: true
|
|
vars:
|
|
elasticsearch_shard_body: {"transient": {"cluster.routing.allocation.enable": "none"}}
|
|
kolla_toolbox:
|
|
module_name: uri
|
|
module_args:
|
|
url: "{{ elasticsearch_internal_endpoint }}/_cluster/settings"
|
|
method: PUT
|
|
status_code: 200
|
|
return_content: yes
|
|
body: "{{ elasticsearch_shard_body | to_json }}"
|
|
body_format: json
|
|
delegate_to: "{{ groups['elasticsearch'][0] }}"
|
|
run_once: true
|
|
|
|
- name: Perform a synced flush
|
|
become: true
|
|
kolla_toolbox:
|
|
module_name: uri
|
|
module_args:
|
|
url: "{{ elasticsearch_internal_endpoint }}/_flush/synced"
|
|
method: POST
|
|
status_code: 200
|
|
return_content: yes
|
|
body_format: json
|
|
delegate_to: "{{ groups['elasticsearch'][0] }}"
|
|
run_once: true
|
|
retries: 10
|
|
delay: 5
|
|
register: result
|
|
until: ('status' in result) and result.status == 200
|
|
|
|
# Stop all elasticsearch containers before applying configuration to ensure
|
|
# handlers are triggered to restart them.
|
|
- name: Stopping all elasticsearch containers
|
|
vars:
|
|
service_name: "elasticsearch"
|
|
service: "{{ elasticsearch_services[service_name] }}"
|
|
become: true
|
|
kolla_docker:
|
|
action: "stop_container"
|
|
common_options: "{{ docker_common_options }}"
|
|
name: "elasticsearch"
|
|
image: "{{ service.image }}"
|
|
environment: "{{ service.environment }}"
|
|
volumes: "{{ service.volumes }}"
|
|
when: inventory_hostname in groups[service.group]
|
|
|
|
- import_tasks: config-host.yml
|
|
|
|
- import_tasks: config.yml
|
|
|
|
- import_tasks: check-containers.yml
|
|
|
|
- name: Flush handlers
|
|
meta: flush_handlers
|