elastic / ansible-elasticsearch

Ansible playbook for Elasticsearch
Other
1.58k stars 854 forks source link

Xpack activation failed without "security" in features #332

Closed y0an closed 7 years ago

y0an commented 7 years ago

The task elasticsearch-xpack-activation failed when security is not enabled.

TASK [elasticsearch : Activate ES license (without security authentication)] *** ok: [host]

TASK [elasticsearch : Activate ES license (with security authentication)] ** skipping: [host]

TASK [elasticsearch : debug] *** fatal: [host]: FAILED! => {"failed": true, "msg": "the field 'args' has an invalid v alue, which appears to include a variable that is undefined. The error was: 'dict object' has no attribute 'content'\n\nThe error appears to have been in '/home/yoan/git/rocher/omnichannel-tooling/watchpet/external s_roles/elasticsearch/tasks/xpack/security/elasticsearch-xpack-activation.yml': line 36, column 3, but may\ nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n - debug:\n ^ here\n"}`

The problem comes from the debug message at the end of the task:

- debug:
    msg: "License: {{ license_activated.content }}"

The var _licenseactivated is populated by register method, but when the security is disabled, the first action Activate ES license (without security authentication) is executed, the second Activate ES license (with security authentication) is skipped BUT _licenseactivated variable is populated by ansible with :

{'skip_reason': u'Conditional check failed', 'skipped': True, 'changed': False}

There's no content attribute, the debug message failed and the playbook too :crying_cat_face:

kremers commented 7 years ago

This is fixed by: PR 338

gingerwizard commented 7 years ago

Fixed as part of https://github.com/elastic/ansible-elasticsearch/pull/361