2016-09-27 16:59:20 +02:00
|
|
|
---
|
2017-01-04 13:23:22 +00:00
|
|
|
|
2016-09-21 17:04:31 +02:00
|
|
|
- name: Activate ES license (without shield authentication)
|
|
|
|
|
uri:
|
|
|
|
|
method: PUT
|
2017-01-04 13:23:22 +00:00
|
|
|
url: "http://{{es_api_host}}:{{es_api_port}}/_license?acknowledge=true"
|
2016-09-21 17:04:31 +02:00
|
|
|
body_format: json
|
|
|
|
|
body: "{{ es_xpack_license }}"
|
|
|
|
|
return_content: yes
|
|
|
|
|
register: license_activated
|
|
|
|
|
no_log: True
|
2017-01-04 13:23:22 +00:00
|
|
|
when: not '"shield" in es_xpack_features'
|
2016-09-21 17:04:31 +02:00
|
|
|
failed_when: >
|
|
|
|
|
license_activated.status != 200 or
|
2016-09-27 16:59:20 +02:00
|
|
|
license_activated.json.license_status is not defined or
|
2016-09-21 17:04:31 +02:00
|
|
|
license_activated.json.license_status != 'valid'
|
|
|
|
|
|
|
|
|
|
- name: Activate ES license (with shield authentication)
|
|
|
|
|
uri:
|
|
|
|
|
method: PUT
|
2017-01-04 13:23:22 +00:00
|
|
|
url: "http://{{es_api_host}}:{{es_api_port}}/_license?acknowledge=true"
|
2016-09-21 17:04:31 +02:00
|
|
|
user: "{{es_api_basic_auth_username}}"
|
|
|
|
|
password: "{{es_api_basic_auth_password}}"
|
|
|
|
|
body_format: json
|
|
|
|
|
force_basic_auth: yes
|
|
|
|
|
body: "{{ es_xpack_license }}"
|
|
|
|
|
return_content: yes
|
|
|
|
|
register: license_activated
|
2017-01-04 13:28:38 +00:00
|
|
|
no_log: True
|
2017-01-04 13:23:22 +00:00
|
|
|
when: '"shield" in es_xpack_features'
|
2016-09-21 17:04:31 +02:00
|
|
|
failed_when: >
|
|
|
|
|
license_activated.status != 200 or
|
2016-09-27 16:59:20 +02:00
|
|
|
license_activated.json.license_status is not defined or
|
2016-09-21 17:04:31 +02:00
|
|
|
license_activated.json.license_status != 'valid'
|
|
|
|
|
|
|
|
|
|
- debug:
|
|
|
|
|
msg: "License: {{ license_activated.content }}"
|