Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Fixes bug #326 and adds the option to configure mail #445

Merged
merged 25 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
34f0813
Added changes to add required functionality and fix a bug
jeffrey-e Apr 24, 2018
7aebcae
Added documentation for added features
jeffrey-e Apr 26, 2018
6cf11ef
Merge branch 'master' into master
jeffrey-e Apr 27, 2018
7640a03
Update elasticsearch.yml.j2
jeffrey-e May 3, 2018
4caefef
Added es_action_auto_create_index: true
jeffrey-e May 3, 2018
11a1e4b
Adjust variable name to match standard
jeffrey-e May 3, 2018
96f3a87
Fixed documentation
jeffrey-e May 3, 2018
da527ec
Added support for providing an array with indices
jeffrey-e May 3, 2018
cc28b61
Added more x-pack config options
jeffrey-e May 3, 2018
4791195
Sync with HEAD
jeffrey-e May 3, 2018
a3ea8e0
Fixed documentation commit issue
jeffrey-e May 3, 2018
80baf26
SSL support optimisation
jeffrey-e May 5, 2018
b1e350f
Revert "Added support for providing an array with indices"
jeffrey-e May 5, 2018
40e5252
Added support for providing an array with indices
jeffrey-e May 3, 2018
ba080bc
Revert "SSL support optimisation"
jeffrey-e May 5, 2018
ff9a64b
Revert "Fixed documentation commit issue"
jeffrey-e May 5, 2018
7967317
Removing ssl configuration
jeffrey-e May 5, 2018
9ba1082
Commit README as well
jeffrey-e May 5, 2018
01fd5ce
Merging went wrong
jeffrey-e May 5, 2018
e880cdf
test
jeffrey-e May 3, 2018
8cfa0cf
Merged change
jeffrey-e May 5, 2018
d72ce3c
Added path repo is defined statement again
jeffrey-e May 8, 2018
31ee9af
Merge branch 'master' into master
itsmed May 22, 2018
c79fd2e
Readded es_action_auto_create_index
jeffrey-e May 22, 2018
cf4da01
Fixed es_mail_config again
jeffrey-e May 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ In addition to es_config, the following parameters allow the customization of th
es_plugins:
- plugin: ingest-geoip
```
* ```es_path_repo``` Sets the whitelist for allowing local back-up repositories
* ```es_action_auto_create_index ``` Sets the value for auto index creation, use the syntax below for specifying indexes (else true/false):
es_action_auto_create_index: '[".watches", ".triggered_watches", ".watcher-history-*"]'
* ```es_allow_downgrades``` For development purposes only. (true or false (default) )
* ```es_java_install``` If set to false, Java will not be installed. (true (default) or false)
* ```update_java``` Updates Java to the latest version. (true or false (default))
Expand All @@ -352,7 +355,20 @@ In addition to es_config, the following parameters allow the customization of th

Earlier examples illustrate the installation of plugins using `es_plugins`. 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. For community based plugins include the full url. This approach should NOT be used for the X-Pack plugin. See X-Pack below for details here.

If installing Monitoring or Alerting, ensure the license plugin is also specified. Security configuration is currently not supported but planned for later versions.
If installing Monitoring or Alerting, ensure the license plugin is also specified. Security configuration currently has limited support, but more support is planned for later versions.

To configure X-pack to send mail, the following configuration can be added to the role. When require_auth is true, you will also need to provide the user and password. If not these can be removed:
```
es_mail_config:
account: <functional name>
profile: standard
from: <from address>
require_auth: <true or false>
host: <mail domain>
port: <port number>
user: <e-mail address> --optional
pass: <password> --optional
```

* ```es_user``` - defaults to elasticsearch.
* ```es_group``` - defaults to elasticsearch.
Expand Down
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ es_config_log4j2: log4j2.properties.j2
es_pid_dir: "/var/run/elasticsearch"
es_data_dirs: "/var/lib/elasticsearch"
es_log_dir: "/var/log/elasticsearch"
es_action_auto_create_index: true
es_max_open_files: 65536
es_max_threads: "{{ 2048 if ( es_version | version_compare('6.0.0', '<')) else 8192 }}"
es_max_map_count: 262144
Expand Down
8 changes: 4 additions & 4 deletions tasks/elasticsearch-Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
- { repo: "{{ es_apt_url }}", state: "present" }
when: es_use_repository

- name: Debian - Include versionlock
include: elasticsearch-Debian-version-lock.yml
when: es_version_lock

- name: Debian - Ensure elasticsearch is installed
become: yes
apt: name=elasticsearch{% if es_version is defined and es_version != "" %}={{ es_version }}{% endif %} state=present force={{force_install}} allow_unauthenticated={{ 'no' if es_apt_key else 'yes' }} cache_valid_time=86400
when: es_use_repository
register: debian_elasticsearch_install_from_repo
notify: restart elasticsearch

- name: Debian - Include versionlock
include: elasticsearch-Debian-version-lock.yml
when: es_version_lock

- name: Debian - Download elasticsearch from url
get_url: url={% if es_custom_package_url is defined %}{{ es_custom_package_url }}{% else %}{{ es_package_url }}-{{ es_version }}.deb{% endif %} dest=/tmp/elasticsearch-{{ es_version }}.deb validate_certs=no
when: not es_use_repository
Expand Down
2 changes: 1 addition & 1 deletion tasks/xpack/elasticsearch-xpack.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: set fact es_version_changed
set_fact: es_version_changed={{ ((elasticsearch_install_from_package is defined and ((debian_elasticsearch_install_from_repo is defined and debian_elasticsearch_install_from_repo.changed) or (redhat_elasticsearch_install_from_repo is defined and redhat_elasticsearch_install_from_repo.changed))) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) }}
set_fact: es_version_changed={{ ((elasticsearch_install_from_package is defined and (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) }}

- name: include elasticsearch-xpack-install.yml
include: elasticsearch-xpack-install.yml
Expand Down
29 changes: 29 additions & 0 deletions templates/elasticsearch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ path.data: {{ data_dirs | array_to_str }}

path.logs: {{ log_dir }}

{% if es_path_repo is defined %}
path.repo: {{ es_path_repo }}
{% endif %}

{% if es_action_auto_create_index == true %}
action.auto_create_index: true
{% elif not es_action_auto_create_index %}
action.auto_create_index: false
{% else %}
action.auto_create_index: {{ es_action_auto_create_index }}
{% endif %}

{% if es_enable_xpack %}
{% if not "security" in es_xpack_features %}
xpack.security.enabled: false
Expand All @@ -44,3 +56,20 @@ xpack.ml.enabled: false
xpack.graph.enabled: false
{% endif %}
{% endif %}

{% if es_mail_config is defined %}
xpack.notification.email:
account:
{{ es_mail_config['account'] }}:
profile: {{ es_mail_config['profile'] }}
email_defaults:
from: {{ es_mail_config['from'] }}
smtp:
auth: {{ es_mail_config['require_auth'] }}
host: {{ es_mail_config['host'] }}
port: {{ es_mail_config['port'] }}
{% if es_mail_config['require_auth'] == true %}
user: {{ es_mail_config['user'] }}
password: {{ es_mail_config['pass'] }}
{% endif %}
{% endif %}