Merge "Fix invalid JSON body in Elasticsearch API requests"
This commit is contained in:
commit
31fe3c0651
@ -3,6 +3,8 @@
|
|||||||
# https://www.elastic.co/guide/en/elasticsearch/reference/5.6/restart-upgrade.html
|
# https://www.elastic.co/guide/en/elasticsearch/reference/5.6/restart-upgrade.html
|
||||||
- name: Disable shard allocation
|
- name: Disable shard allocation
|
||||||
become: true
|
become: true
|
||||||
|
vars:
|
||||||
|
elasticsearch_shard_body: {"transient": {"cluster.routing.allocation.enable": "none"}}
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
module_name: uri
|
module_name: uri
|
||||||
module_args:
|
module_args:
|
||||||
@ -10,7 +12,7 @@
|
|||||||
method: PUT
|
method: PUT
|
||||||
status_code: 200
|
status_code: 200
|
||||||
return_content: yes
|
return_content: yes
|
||||||
body: {"transient": {"cluster.routing.allocation.enable": "none"}}
|
body: "{{ elasticsearch_shard_body | to_json }}"
|
||||||
body_format: json
|
body_format: json
|
||||||
delegate_to: "{{ groups['elasticsearch'][0] }}"
|
delegate_to: "{{ groups['elasticsearch'][0] }}"
|
||||||
run_once: true
|
run_once: true
|
||||||
|
@ -37,14 +37,16 @@
|
|||||||
run_once: true
|
run_once: true
|
||||||
|
|
||||||
- name: Change kibana config to set index as defaultIndex
|
- name: Change kibana config to set index as defaultIndex
|
||||||
|
vars:
|
||||||
|
kibana_default_index_body:
|
||||||
|
defaultIndex: "{{ kibana_default_index_pattern }}"
|
||||||
become: true
|
become: true
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
module_name: uri
|
module_name: uri
|
||||||
module_args:
|
module_args:
|
||||||
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ elasticsearch_port }}/.kibana/config/*"
|
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ elasticsearch_port }}/.kibana/config/*"
|
||||||
method: PUT
|
method: PUT
|
||||||
body:
|
body: "{{ kibana_default_index_body | to_json }}"
|
||||||
defaultIndex: "{{ kibana_default_index_pattern }}"
|
|
||||||
body_format: json
|
body_format: json
|
||||||
status_code: 200, 201
|
status_code: 200, 201
|
||||||
run_once: true
|
run_once: true
|
||||||
|
@ -32,6 +32,9 @@
|
|||||||
|
|
||||||
- name: Create default control plane organisation if it doesn't exist
|
- name: Create default control plane organisation if it doesn't exist
|
||||||
become: true
|
become: true
|
||||||
|
vars:
|
||||||
|
monasca_orgs_body:
|
||||||
|
name: '{{ monasca_grafana_control_plane_org }}'
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
module_name: uri
|
module_name: uri
|
||||||
module_args:
|
module_args:
|
||||||
@ -40,8 +43,7 @@
|
|||||||
user: '{{ monasca_grafana_admin_username }}'
|
user: '{{ monasca_grafana_admin_username }}'
|
||||||
password: '{{ monasca_grafana_admin_password }}'
|
password: '{{ monasca_grafana_admin_password }}'
|
||||||
body_format: json
|
body_format: json
|
||||||
body:
|
body: "{{ monasca_orgs_body | to_json }}"
|
||||||
name: '{{ monasca_grafana_control_plane_org }}'
|
|
||||||
force_basic_auth: true
|
force_basic_auth: true
|
||||||
run_once: True
|
run_once: True
|
||||||
when: monasca_grafana_control_plane_org not in monasca_grafana_orgs.json|map(attribute='name')|unique
|
when: monasca_grafana_control_plane_org not in monasca_grafana_orgs.json|map(attribute='name')|unique
|
||||||
@ -61,6 +63,10 @@
|
|||||||
register: monasca_grafana_conf_org
|
register: monasca_grafana_conf_org
|
||||||
|
|
||||||
- name: Add {{ monasca_grafana_admin_username }} user to control plane organisation
|
- name: Add {{ monasca_grafana_admin_username }} user to control plane organisation
|
||||||
|
vars:
|
||||||
|
monasca_user_body:
|
||||||
|
loginOrEmail: '{{ monasca_grafana_admin_username }}'
|
||||||
|
role: Admin
|
||||||
become: true
|
become: true
|
||||||
kolla_toolbox:
|
kolla_toolbox:
|
||||||
module_name: uri
|
module_name: uri
|
||||||
@ -69,9 +75,7 @@
|
|||||||
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/{{ monasca_grafana_conf_org.json.id }}/users"
|
url: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ monasca_grafana_server_port }}/api/orgs/{{ monasca_grafana_conf_org.json.id }}/users"
|
||||||
user: '{{ monasca_grafana_admin_username }}'
|
user: '{{ monasca_grafana_admin_username }}'
|
||||||
password: '{{ monasca_grafana_admin_password }}'
|
password: '{{ monasca_grafana_admin_password }}'
|
||||||
body:
|
body: "{{ monasca_user_body | to_json }}"
|
||||||
loginOrEmail: '{{ monasca_grafana_admin_username }}'
|
|
||||||
role: Admin
|
|
||||||
force_basic_auth: true
|
force_basic_auth: true
|
||||||
body_format: json
|
body_format: json
|
||||||
status_code: 200, 409
|
status_code: 200, 409
|
||||||
|
7
releasenotes/notes/uri-json-body-46891dd478d2ad37.yaml
Normal file
7
releasenotes/notes/uri-json-body-46891dd478d2ad37.yaml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes an issue where Elasticsearch API requests made during Kibana,
|
||||||
|
Elasticsearch and Monasca deployment could have an invalid body. See `bug
|
||||||
|
1864177 <https://bugs.launchpad.net/kolla-ansible/+bug/1864177>`_ for
|
||||||
|
details.
|
Loading…
Reference in New Issue
Block a user