diff --git a/tasks/xpack/security/elasticsearch-security-native.yml b/tasks/xpack/security/elasticsearch-security-native.yml index 96bedfa..4b1c8fd 100644 --- a/tasks/xpack/security/elasticsearch-security-native.yml +++ b/tasks/xpack/security/elasticsearch-security-native.yml @@ -81,12 +81,13 @@ - set_fact: current_roles={{ role_list_response.json | filter_reserved }} when: manage_native_roles + - debug: msg="{{current_roles}}" + when: manage_native_roles - set_fact: roles_to_remove={{ current_roles | difference ( es_roles.native.keys() ) }} when: manage_native_roles - #Delete all non required roles - name: Delete Native Roles uri: diff --git a/tasks/xpack/security/elasticsearch-security.yml b/tasks/xpack/security/elasticsearch-security.yml index 96aedb1..f6007ba 100644 --- a/tasks/xpack/security/elasticsearch-security.yml +++ b/tasks/xpack/security/elasticsearch-security.yml @@ -9,12 +9,12 @@ changed_when: False when: - es_enable_xpack and '"security" in es_xpack_features' - - (es_users is defined and es_users.file) or (es_roles is defined and es_roles.file is defined) or (es_role_mapping is defined) + - (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) #-----------------------------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) 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 ---------------------------------------- diff --git a/test/integration/issue-test.yml b/test/integration/issue-test.yml index fe7f9ba..ae5c7f3 100644 --- a/test/integration/issue-test.yml +++ b/test/integration/issue-test.yml @@ -4,9 +4,21 @@ #Idempot test is enabled for this test - name: Simple Example hosts: localhost - remote_user: root - become: yes - become_method: sudo roles: - - { role: elasticsearch, es_instance_name: "node1" } - vars: \ No newline at end of file + - { role: elasticsearch, es_config: { "xpack.security.authc.realms.file1.type": "file", "xpack.security.authc.realms.file1.order": 1, "xpack.security.authc.realms.native1.type": "native", "xpack.security.authc.realms.native1.order": 0 }, es_instance_name: "security_node" } + vars: + es_heap_size: "1g" + es_enable_xpack: true + es_plugins: + - plugin: ingest-geoip + es_xpack_features: + - security + - alerting + es_api_basic_auth_username: elastic + es_api_basic_auth_password: changeme + es_users: + native: + testUser: + password: changeme + roles: + - kibana_user \ No newline at end of file