00_base.yaml 1.02 KiB
- name: "Install Elastic 7"
hosts: es7-1
tasks:
- name: Install components and prerequisites
include_tasks: 01_install-components.yaml
- name: Install Elastic
include_tasks: 02_install-elastic.yaml
- name: Update Elasticsearch configuration file
lineinfile:
path: /etc/elasticsearch/elasticsearch.yml
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
with_items:
- { regexp: '^cluster.name:', line: 'cluster.name: es7' }
- { regexp: '^node.name:', line: 'node.name: es7-1' }
- { regexp: '^bootstrap.memory_lock:', line: 'bootstrap.memory_lock: true' }
- { regexp: '^network.host:', line: 'network.host: _eth0_' }
- { regexp: '^http.port:', line: 'http.port: 9200' }
- { regexp: '^discovery.seed_hosts:', line: 'discovery.seed_hosts: ["es7-1"]' }
- { regexp: '^cluster.initial_master_nodes:', line: 'cluster.initial_master_nodes: ["es7-1"]' }
- name: Configure Elastic
include_tasks: 03_configure-elastic.yaml