You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 24, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+98-3Lines changed: 98 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ The use of a map ensures the Ansible playbook does not need to be updated to ref
47
47
48
48
In addition to the es_config map, several other parameters are supported for additional functions e.g. script installation. These can be found in the role's defaults/main.yml file.
49
49
50
-
The following illustrates applying configuration parameters to an Elasticsearch instance. By default, Elasticsearch 2.3.4 is installed.
50
+
The following illustrates applying configuration parameters to an Elasticsearch instance. By default, Elasticsearch 2.4.3 is installed.
51
51
52
52
```
53
53
- name: Elasticsearch with custom configuration
@@ -209,6 +209,99 @@ Then run it:
209
209
ansible-playbook -i hosts ./your-playbook.yml
210
210
```
211
211
212
+
### Installing X-Pack Features
213
+
214
+
X-Pack features, such as Shield, are supported for Elasticsearch 2.4 only. This feature is currently experimental. To enable X-Pack set the parameter `es_enable_xpack` to true and list the required features in the parameter `es_xpack_features`. The following additional parameters allow X-Pack to be configured:
215
+
216
+
*```es_message_auth_file``` System Key field to allow message authentication. This file should be placed in the 'files' directory.
217
+
*```es_role_mapping``` Role mappings file declared as yml as described [here](https://www.elastic.co/guide/en/shield/current/mapping-roles.html)
218
+
219
+
```
220
+
es_role_mapping:
221
+
power_user:
222
+
- "cn=admins,dc=example,dc=com"
223
+
user:
224
+
- "cn=users,dc=example,dc=com"
225
+
- "cn=admins,dc=example,dc=com"
226
+
```
227
+
228
+
*```es_users``` - Users can be declared here as yml. Two sub keys 'native' and 'file' determine the realm under which realm the user is created. Beneath each of these keys users should be declared as yml entries. e.g.
229
+
230
+
```
231
+
es_users:
232
+
native:
233
+
kibana4_server:
234
+
password: changeMe
235
+
roles:
236
+
- kibana4_server
237
+
file:
238
+
es_admin:
239
+
password: changeMe
240
+
roles:
241
+
- admin
242
+
testUser:
243
+
password: changeMeAlso!
244
+
roles:
245
+
- power_user
246
+
- user
247
+
```
248
+
249
+
250
+
*```es_roles``` - Elasticsearch roles can be declared here as yml. Two sub keys 'native' and 'file' determine how the role is created i.e. either through a file or http(native) call. Beneath each key list the roles with appropriate permissions, using the file based format described [here] (https://www.elastic.co/guide/en/shield/current/_file_based_roles.html) e.g.
251
+
252
+
```
253
+
es_roles:
254
+
file:
255
+
admin:
256
+
cluster:
257
+
- all
258
+
indices:
259
+
- names: '*'
260
+
privileges:
261
+
- all
262
+
power_user:
263
+
cluster:
264
+
- monitor
265
+
indices:
266
+
- names: '*'
267
+
privileges:
268
+
- all
269
+
user:
270
+
indices:
271
+
- names: '*'
272
+
privileges:
273
+
- read
274
+
kibana4_server:
275
+
cluster:
276
+
- monitor
277
+
indices:
278
+
- names: '.kibana'
279
+
privileges:
280
+
- all
281
+
native:
282
+
logstash:
283
+
cluster:
284
+
- manage_index_templates
285
+
indices:
286
+
- names: 'logstash-*'
287
+
privileges:
288
+
- write
289
+
- delete
290
+
- create_index
291
+
```
292
+
293
+
*```es_xpack_license``` - X-Pack license. The license should be declared as a json blob. Alternative use Ansible vault or copy the license to the target machine as part of a playbook and access via a lookup e.g.
X-Pack configuration parameters can be added to the elasticsearch.yml file using the normal `es_config` parameter.
300
+
301
+
For a full example see [here](https://github.com/elastic/ansible-elasticsearch/blob/master/test/integration/xpack.yml)
302
+
303
+
304
+
212
305
### Additional Configuration
213
306
214
307
Additional parameters to es_config allow the customization of the Java and Elasticsearch versions, in addition to role behaviour. Options include:
@@ -219,6 +312,8 @@ Following variables affect the versions installed:
219
312
*```es_version``` (e.g. "2.4.2").
220
313
*```es_api_host``` The host name used for actions requiring HTTP e.g. installing templates. Defaults to "localhost".
221
314
*```es_api_port``` The port used for actions requiring HTTP e.g. installing templates. Defaults to 9200.
315
+
*```es_api_basic_auth_username``` The Elasticsearch username for making admin changing actions. Used if Shield is enabled. Ensure this user is admin.
316
+
*```es_api_basic_auth_password``` The password associated with the user declared in `es_api_basic_auth_username`
222
317
*```es_start_service``` (true (default) or false)
223
318
*```es_plugins_reinstall``` (true or false (default) )
224
319
*```es_plugins``` an array of plugin definitions e.g.:
@@ -239,7 +334,7 @@ es_java_opts:
239
334
Earlier examples illustrate the installation of plugins for 2.x. The correct use of this parameter varies depending on the version of Elasticsearch being installed:
240
335
241
336
- 2.x. - For officially supported plugins no version or source delimiter is required. The plugin script will determine the appropriate plugin version based on the target Elasticsearch version.
242
-
For community based plugins include the full path e.g. "lmenezes/elasticsearch-kopf" and the appropriate version for the target version of Elasticsearch.
337
+
For community based plugins include the full path e.g. "lmenezes/elasticsearch-kopf" and the appropriate version for the target version of Elasticsearch. This approach should NOT be used for X-Pack related plugins e.g. Shield. See X-Pack below for details here.
243
338
244
339
If installing Marvel or Watcher, ensure the license plugin is also specified. Shield configuration is currently not supported but planned for later versions.
245
340
@@ -288,7 +383,7 @@ To define proxy only for a particular plugin during its installation:
288
383
* The role assumes the user/group exists on the server. The elasticsearch packages create the default elasticsearch user. If this needs to be changed, ensure the user exists.
289
384
* The playbook relies on the inventory_name of each host to ensure its directories are unique
290
385
* Changing an instance_name for a role application will result in the installation of a new component. The previous component will remain.
291
-
* KitchenCI has been used for testing. This is used to confirm images reach the correct state after a play is first applied. We currently test only the latest version of each major release i.e. 1.7.3 and 2.3.4 on
386
+
* KitchenCI has been used for testing. This is used to confirm images reach the correct state after a play is first applied. We currently test only the latest version of 2.x on
292
387
all supported platforms.
293
388
* The role aims to be idempotent. Running the role multiple times, with no changes, should result in no state change on the server. If the configuration is changed, these will be applied and
0 commit comments