--- - name: Activate ES license (with security authentication) uri: method: PUT url: "http://{{es_api_host}}:{{es_api_port}}/_xpack/license?acknowledge=true" user: "{{es_api_basic_auth_username | default(omit)}}" password: "{{es_api_basic_auth_password | default(omit)}}" body_format: json body: "{{ es_xpack_license }}" return_content: yes force_basic_auth: yes register: license_activated no_log: True 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 }}"