Changes to support license
This commit is contained in:
parent
6ef629a869
commit
2ea0842a6c
12 changed files with 35 additions and 31 deletions
|
|
@ -1,11 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Ensure elasticsearch is started
|
||||
service: name={{instance_init_script | basename}} state=started enabled=yes
|
||||
|
||||
- name: Wait for elasticsearch to startup
|
||||
wait_for: host={{es_api_host}} port={{es_api_port}} delay=10
|
||||
|
||||
- set_fact: manage_native_users=false
|
||||
|
||||
- set_fact: manage_native_users=true
|
||||
|
|
|
|||
9
handlers/shield/elasticsearch-shield.yml
Normal file
9
handlers/shield/elasticsearch-shield.yml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: activate-license
|
||||
include: ./handlers/shield/elasticsearch-xpack-activation.yml
|
||||
when: es_enable_xpack and es_xpack_license is defined and es_xpack_license != ''
|
||||
|
||||
- name: load-native-realms
|
||||
include: ./handlers/shield/elasticsearch-shield-native.yml
|
||||
when: (es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)
|
||||
37
handlers/shield/elasticsearch-xpack-activation.yml
Normal file
37
handlers/shield/elasticsearch-xpack-activation.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
|
||||
- name: Activate ES license (without shield authentication)
|
||||
uri:
|
||||
method: PUT
|
||||
url: "http://{{es_api_host}}:{{es_api_port}}/_license?acknowledge=true"
|
||||
body_format: json
|
||||
body: "{{ es_xpack_license }}"
|
||||
return_content: yes
|
||||
register: license_activated
|
||||
no_log: True
|
||||
when: not '"shield" in es_xpack_features'
|
||||
failed_when: >
|
||||
license_activated.status != 200 or
|
||||
license_activated.json.license_status is not defined or
|
||||
license_activated.json.license_status != 'valid'
|
||||
|
||||
- name: Activate ES license (with shield authentication)
|
||||
uri:
|
||||
method: PUT
|
||||
url: "http://{{es_api_host}}:{{es_api_port}}/_license?acknowledge=true"
|
||||
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
|
||||
#no_log: True
|
||||
when: '"shield" in es_xpack_features'
|
||||
failed_when: >
|
||||
license_activated.status != 200 or
|
||||
license_activated.json.license_status is not defined or
|
||||
license_activated.json.license_status != 'valid'
|
||||
|
||||
- debug:
|
||||
msg: "License: {{ license_activated.content }}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue