Merge "Fix OpenSearch upgrade tasks idempotency"
This commit is contained in:
commit
eb21d4f929
@ -1,4 +1,45 @@
|
||||
---
|
||||
- name: Disable shard allocation
|
||||
become: true
|
||||
vars:
|
||||
opensearch_shard_body: {"transient": {"cluster.routing.allocation.enable": "none"}}
|
||||
kolla_toolbox:
|
||||
container_engine: "{{ kolla_container_engine }}"
|
||||
module_name: uri
|
||||
module_args:
|
||||
url: "{{ opensearch_internal_endpoint }}/_cluster/settings"
|
||||
method: PUT
|
||||
status_code: 200
|
||||
return_content: yes
|
||||
body: "{{ opensearch_shard_body | to_json }}" # noqa jinja[invalid]
|
||||
body_format: json
|
||||
delegate_to: "{{ groups['opensearch'][0] }}"
|
||||
run_once: true
|
||||
listen: "Restart opensearch container"
|
||||
when:
|
||||
- kolla_action == "upgrade"
|
||||
|
||||
- name: Perform a flush
|
||||
become: true
|
||||
kolla_toolbox:
|
||||
container_engine: "{{ kolla_container_engine }}"
|
||||
module_name: uri
|
||||
module_args:
|
||||
url: "{{ opensearch_internal_endpoint }}/_flush"
|
||||
method: POST
|
||||
status_code: 200
|
||||
return_content: yes
|
||||
body_format: json
|
||||
delegate_to: "{{ groups['opensearch'][0] }}"
|
||||
run_once: true
|
||||
retries: 10
|
||||
delay: 5
|
||||
register: result
|
||||
until: ('status' in result) and result.status == 200
|
||||
listen: "Restart opensearch container"
|
||||
when:
|
||||
- kolla_action == "upgrade"
|
||||
|
||||
- name: Restart opensearch container
|
||||
vars:
|
||||
service_name: "opensearch"
|
||||
|
@ -1,39 +1,4 @@
|
||||
---
|
||||
- name: Disable shard allocation
|
||||
become: true
|
||||
vars:
|
||||
opensearch_shard_body: {"transient": {"cluster.routing.allocation.enable": "none"}}
|
||||
kolla_toolbox:
|
||||
container_engine: "{{ kolla_container_engine }}"
|
||||
module_name: uri
|
||||
module_args:
|
||||
url: "{{ opensearch_internal_endpoint }}/_cluster/settings"
|
||||
method: PUT
|
||||
status_code: 200
|
||||
return_content: yes
|
||||
body: "{{ opensearch_shard_body | to_json }}" # noqa jinja[invalid]
|
||||
body_format: json
|
||||
delegate_to: "{{ groups['opensearch'][0] }}"
|
||||
run_once: true
|
||||
|
||||
- name: Perform a flush
|
||||
become: true
|
||||
kolla_toolbox:
|
||||
container_engine: "{{ kolla_container_engine }}"
|
||||
module_name: uri
|
||||
module_args:
|
||||
url: "{{ opensearch_internal_endpoint }}/_flush"
|
||||
method: POST
|
||||
status_code: 200
|
||||
return_content: yes
|
||||
body_format: json
|
||||
delegate_to: "{{ groups['opensearch'][0] }}"
|
||||
run_once: true
|
||||
retries: 10
|
||||
delay: 5
|
||||
register: result
|
||||
until: ('status' in result) and result.status == 200
|
||||
|
||||
- import_tasks: config-host.yml
|
||||
|
||||
- import_tasks: config.yml
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes an idempotency issue in the OpenSearch upgrade tasks where subsequent
|
||||
runs of kolla-ansible upgrade would leave shard allocation disabled.
|
||||
`LP#2049512 <https://launchpad.net/bugs/2049512>`__
|
Loading…
x
Reference in New Issue
Block a user