From 27d81e68ddfd967d12665e4ab081e9e239eb1c91 Mon Sep 17 00:00:00 2001 From: pemontto Date: Fri, 16 Feb 2018 16:37:00 -0500 Subject: [PATCH] Fix conditionals introduced in #408 --- tasks/main.yml | 2 +- tasks/xpack/security/elasticsearch-security.yml | 10 +++++----- .../xpack/security/elasticsearch-xpack-activation.yml | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 0f3de038..245c9ea2 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -50,7 +50,7 @@ - set_fact: manage_native_realm=false - set_fact: manage_native_realm=true - when: es_start_service and (es_enable_xpack and '"security" in es_xpack_features') and ((es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)) + when: es_start_service and (es_enable_xpack and "security" in es_xpack_features) and ((es_users is defined and es_users.native is defined) or (es_roles is defined and es_roles.native is defined)) # If playbook runs too fast, Native commands could fail as the Native Realm is not yet up - name: Wait 15 seconds for the Native Relm to come up diff --git a/tasks/xpack/security/elasticsearch-security.yml b/tasks/xpack/security/elasticsearch-security.yml index 1d7d93b0..14f4d203 100644 --- a/tasks/xpack/security/elasticsearch-security.yml +++ b/tasks/xpack/security/elasticsearch-security.yml @@ -8,7 +8,7 @@ file: path={{ conf_dir }}/x-pack state=directory owner={{ es_user }} group={{ es_group }} changed_when: False when: - - es_enable_xpack and '"security" in es_xpack_features' + - es_enable_xpack and "security" in es_xpack_features - (es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined) or (es_role_mapping is defined) #-----------------------------Create Bootstrap User----------------------------------- @@ -20,12 +20,12 @@ environment: ES_PATH_CONF: "{{ conf_dir }}" when: - - (es_enable_xpack and '"security" in es_xpack_features') and (es_version | version_compare('6.0.0', '>')) + - (es_enable_xpack and "security" in es_xpack_features) and (es_version | version_compare('6.0.0', '>')) - name: Create Bootstrap password for elastic user shell: echo "{{es_api_basic_auth_password}}" | {{es_home}}/bin/elasticsearch-keystore add -x 'bootstrap.password' when: - - (es_enable_xpack and '"security" in es_xpack_features') and (es_version | version_compare('6.0.0', '>')) and es_api_basic_auth_username is defined and list_keystore is defined and es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines + - (es_enable_xpack and "security" in es_xpack_features) and (es_version | version_compare('6.0.0', '>')) and es_api_basic_auth_username is defined and list_keystore is defined and es_api_basic_auth_username == 'elastic' and 'bootstrap.password' not in list_keystore.stdout_lines environment: ES_PATH_CONF: "{{ conf_dir }}" no_log: true @@ -33,7 +33,7 @@ #-----------------------------FILE BASED REALM---------------------------------------- - include: elasticsearch-security-file.yml - when: (es_enable_xpack and '"security" in es_xpack_features') and ((es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined)) + when: (es_enable_xpack and "security" in es_xpack_features) and ((es_users is defined and es_users.file is defined) or (es_roles is defined and es_roles.file is defined)) #-----------------------------ROLE MAPPING ---------------------------------------- @@ -57,4 +57,4 @@ become: yes file: path={{ conf_dir }}/security state=directory owner={{ es_user }} group={{ es_group }} changed_when: False - when: es_enable_xpack and '"security" in es_xpack_features' + when: es_enable_xpack and "security" in es_xpack_features diff --git a/tasks/xpack/security/elasticsearch-xpack-activation.yml b/tasks/xpack/security/elasticsearch-xpack-activation.yml index c1f401b7..cd72d6a7 100644 --- a/tasks/xpack/security/elasticsearch-xpack-activation.yml +++ b/tasks/xpack/security/elasticsearch-xpack-activation.yml @@ -9,7 +9,7 @@ return_content: yes register: license_activated no_log: True - when: 'not "security" in es_xpack_features' + when: not "security" in es_xpack_features failed_when: > license_activated.status != 200 or license_activated.json.license_status is not defined or @@ -27,7 +27,7 @@ return_content: yes register: license_activated no_log: True - when: '"security" in es_xpack_features' + when: "'security' in es_xpack_features" failed_when: > license_activated.status != 200 or license_activated.json.license_status is not defined or