Fix deprecated security api endpoint
This commit is contained in:
parent
e516472af0
commit
2fb648fee6
2 changed files with 10 additions and 8 deletions
|
|
@ -42,6 +42,8 @@ es_debian_startup_timeout: 10
|
||||||
# JVM custom parameters
|
# JVM custom parameters
|
||||||
es_jvm_custom_parameters: ''
|
es_jvm_custom_parameters: ''
|
||||||
|
|
||||||
|
es_security_api: "_{{ 'xpack/security' if es_version is version_compare('7.0.0', '<=') else 'security' }}"
|
||||||
|
|
||||||
# SSL/TLS parameters
|
# SSL/TLS parameters
|
||||||
es_enable_http_ssl: false
|
es_enable_http_ssl: false
|
||||||
es_enable_transport_ssl: false
|
es_enable_transport_ssl: false
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#List current users
|
#List current users
|
||||||
- name: List Native Users
|
- name: List Native Users
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/user
|
||||||
method: GET
|
method: GET
|
||||||
user: "{{es_api_basic_auth_username}}"
|
user: "{{es_api_basic_auth_username}}"
|
||||||
password: "{{es_api_basic_auth_password}}"
|
password: "{{es_api_basic_auth_password}}"
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
- name: Update API User Password
|
- name: Update API User Password
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{es_api_basic_auth_username}}/_password
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/user/{{es_api_basic_auth_username}}/_password
|
||||||
method: POST
|
method: POST
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{ \"password\":\"{{native_users[es_api_basic_auth_username].password}}\" }"
|
body: "{ \"password\":\"{{native_users[es_api_basic_auth_username].password}}\" }"
|
||||||
|
|
@ -73,7 +73,7 @@
|
||||||
#Delete all non required users NOT inc. reserved
|
#Delete all non required users NOT inc. reserved
|
||||||
- name: Delete Native Users
|
- name: Delete Native Users
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}}
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/user/{{item}}
|
||||||
method: DELETE
|
method: DELETE
|
||||||
status_code: 200
|
status_code: 200
|
||||||
user: "{{es_api_basic_auth_username}}"
|
user: "{{es_api_basic_auth_username}}"
|
||||||
|
|
@ -94,7 +94,7 @@
|
||||||
#Update password on all reserved users
|
#Update password on all reserved users
|
||||||
- name: Update Reserved User Passwords
|
- name: Update Reserved User Passwords
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}}/_password
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/user/{{item}}/_password
|
||||||
method: POST
|
method: POST
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{ \"password\":\"{{native_users[item].password}}\" }"
|
body: "{ \"password\":\"{{native_users[item].password}}\" }"
|
||||||
|
|
@ -113,7 +113,7 @@
|
||||||
#Overwrite all other users NOT inc. those reserved
|
#Overwrite all other users NOT inc. those reserved
|
||||||
- name: Update Non-Reserved Native User Details
|
- name: Update Non-Reserved Native User Details
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/user/{{item}}
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/user/{{item}}
|
||||||
method: POST
|
method: POST
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{{ native_users[item] | to_json }}"
|
body: "{{ native_users[item] | to_json }}"
|
||||||
|
|
@ -130,7 +130,7 @@
|
||||||
#List current roles not. inc those reserved
|
#List current roles not. inc those reserved
|
||||||
- name: List Native Roles
|
- name: List Native Roles
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/role
|
||||||
method: GET
|
method: GET
|
||||||
body_format: json
|
body_format: json
|
||||||
user: "{{es_api_basic_auth_username}}"
|
user: "{{es_api_basic_auth_username}}"
|
||||||
|
|
@ -165,7 +165,7 @@
|
||||||
#Delete all non required roles NOT inc. reserved
|
#Delete all non required roles NOT inc. reserved
|
||||||
- name: Delete Native Roles
|
- name: Delete Native Roles
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role/{{item}}
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/role/{{item}}
|
||||||
method: DELETE
|
method: DELETE
|
||||||
status_code: 200
|
status_code: 200
|
||||||
user: "{{es_api_basic_auth_username}}"
|
user: "{{es_api_basic_auth_username}}"
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
#Update other roles - NOT inc. reserved roles
|
#Update other roles - NOT inc. reserved roles
|
||||||
- name: Update Native Roles
|
- name: Update Native Roles
|
||||||
uri:
|
uri:
|
||||||
url: http://{{es_api_host}}:{{es_api_port}}/_xpack/security/role/{{item}}
|
url: http://{{es_api_host}}:{{es_api_port}}/{{ es_security_api }}/role/{{item}}
|
||||||
method: POST
|
method: POST
|
||||||
body_format: json
|
body_format: json
|
||||||
body: "{{ es_roles.native[item] | to_json}}"
|
body: "{{ es_roles.native[item] | to_json}}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue