Merge branch 'master' into AddSSLSupport
This commit is contained in:
commit
6f93938c48
15 changed files with 42 additions and 24 deletions
|
|
@ -43,17 +43,21 @@
|
|||
apt_key:
|
||||
url: '{{ es_apt_key }}'
|
||||
state: present
|
||||
when: es_apt_key | string
|
||||
when: es_add_repository and es_apt_key | string
|
||||
|
||||
- name: Debian - Add elasticsearch repository
|
||||
apt_repository:
|
||||
repo: '{{ item.repo }}'
|
||||
state: '{{ item.state }}'
|
||||
when: es_add_repository
|
||||
with_items:
|
||||
- { repo: "{{ es_apt_url_old }}", state: "absent" }
|
||||
- { repo: "{{ es_apt_url }}", state: "present" }
|
||||
- { repo: "{{ es_other_apt_url }}", state: "absent" }
|
||||
|
||||
- name: Include optional user and group creation.
|
||||
when: (es_user_id is defined) and (es_group_id is defined)
|
||||
include: elasticsearch-optional-user.yml
|
||||
|
||||
- name: Debian - Ensure elasticsearch is installed
|
||||
become: yes
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
template:
|
||||
src: 'elasticsearch.repo'
|
||||
dest: '/etc/yum.repos.d/elasticsearch-{{ es_repo_name }}.repo'
|
||||
when: es_use_repository
|
||||
when: es_use_repository and es_add_repository
|
||||
|
||||
- name: RedHat - remove unused Elasticsearch repo
|
||||
become: yes
|
||||
|
|
@ -35,6 +35,10 @@
|
|||
name: '{{ es_other_package_name }}'
|
||||
state: 'absent'
|
||||
|
||||
- name: Include optional user and group creation.
|
||||
when: (es_user_id is defined) and (es_group_id is defined)
|
||||
include: elasticsearch-optional-user.yml
|
||||
|
||||
- name: RedHat - Install Elasticsearch
|
||||
become: yes
|
||||
yum:
|
||||
|
|
|
|||
|
|
@ -24,10 +24,23 @@
|
|||
template: src=elasticsearch.j2 dest={{ default_file }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
|
||||
#Copy the systemd specific file if systemd is installed
|
||||
- when: use_system_d and m_lock_enabled
|
||||
become: yes
|
||||
block:
|
||||
- name: Make sure destination dir exists
|
||||
file: path={{ sysd_config_file | dirname }} state=directory mode=0755
|
||||
|
||||
- name: Copy specific ElasticSearch Systemd config file
|
||||
ini_file: path={{ sysd_config_file }} section=Service option=LimitMEMLOCK value=infinity mode=0644
|
||||
notify:
|
||||
- reload systemd configuration
|
||||
- restart elasticsearch
|
||||
|
||||
#Copy the logging.yml
|
||||
- name: Copy log4j2.properties File
|
||||
become: yes
|
||||
template: src={{es_config_log4j2}} dest={{ es_conf_dir }}/log4j2.properties owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
template: src={{ es_config_log4j2 }} dest={{ es_conf_dir }}/log4j2.properties owner={{ es_user }} group={{ es_group }} mode=0644 force=yes
|
||||
notify: restart elasticsearch
|
||||
|
||||
- name: Copy jvm.options File
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@
|
|||
fail: msg="es_proxy_port must be specified and cannot be blank when es_proxy_host is defined"
|
||||
when: (es_proxy_port is not defined or es_proxy_port == '') and (es_proxy_host is defined and es_proxy_host != '')
|
||||
|
||||
- name: debug message
|
||||
debug: msg="WARNING - It is recommended you specify the parameter 'http.port'"
|
||||
when: es_config['http.port'] is not defined
|
||||
|
||||
#If the user attempts to lock memory they must specify a heap size
|
||||
- name: fail when heap size is not specified when using memory lock
|
||||
fail: msg="If locking memory with bootstrap.memory_lock a heap size must be specified"
|
||||
|
|
@ -32,3 +28,7 @@
|
|||
|
||||
- name: set fact m_lock_enabled
|
||||
set_fact: m_lock_enabled={{ es_config['bootstrap.memory_lock'] is defined and es_config['bootstrap.memory_lock'] == True }}
|
||||
|
||||
- name: set fact use_system_d
|
||||
set_fact: use_system_d={{(ansible_distribution == 'Debian' and ansible_distribution_version is version_compare('8', '>=')) or (ansible_distribution in ['RedHat','CentOS'] and ansible_distribution_version is version_compare('7', '>=')) or (ansible_distribution == 'Ubuntu' and ansible_distribution_version is version_compare('15', '>=')) }}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
status_code: 200
|
||||
user: "{{es_api_basic_auth_username | default(omit)}}"
|
||||
password: "{{es_api_basic_auth_password | default(omit)}}"
|
||||
force_basic_auth: yes
|
||||
body_format: json
|
||||
body: "{{ lookup('file', item) }}"
|
||||
when: load_templates.changed and es_start_service
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
---
|
||||
|
||||
- name: Include optional user and group creation.
|
||||
when: (es_user_id is defined) and (es_group_id is defined)
|
||||
include: elasticsearch-optional-user.yml
|
||||
|
||||
- name: Include specific Elasticsearch
|
||||
include: elasticsearch-Debian.yml
|
||||
when: ansible_os_family == 'Debian'
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
body_format: json
|
||||
body: "{{ es_xpack_license }}"
|
||||
return_content: yes
|
||||
force_basic_auth: yes
|
||||
register: license_activated
|
||||
no_log: True
|
||||
failed_when: >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue