Ansible/roles/elasticsearch/tasks/ubuntu.yml

45 lines
826 B
YAML
Raw Permalink Normal View History

2019-04-26 12:35:26 -07:00
- name: Add Elastic repo
include: install-repo.yml
- name: Install ElasticSearch from apt
become: true
apt:
name: elasticsearch
2019-04-26 12:35:26 -07:00
- name: Update config
become: true
template:
src: elasticsearch.j2
dest: /etc/elasticsearch/elasticsearch.yml
backup: yes
- name: UFW allow http_port
become: true
when: ufw_http_port == true
ufw:
rule: allow
port: "{{ http_port }}"
- name: UFW allow transport_port
become: true
when: ufw_transport_port == true
ufw:
rule: allow
port: "{{ transport_port }}"
- name: systemd enable elasticsearch
become: true
when: systemd_enabled == true
systemd:
name: elasticsearch
enabled: true
- name: systemd restart elasticsearch
become: true
when: systemd_restart == true
systemd:
name: elasticsearch
state: restarted