summaryrefslogtreecommitdiff
path: root/elk.yml
blob: 144ce981eaa177d44fa29f4d2ddbbd895ce20f04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
---
- name: Clone Ansible Elasticsearch role from Github
  hosts: localhost
  connection: local
  tasks:
    - name: check out a git repository
      git:
        repo=https://github.com/elastic/ansible-elasticsearch.git
        version=913e773
        dest=roles/ansible-elasticsearch
        update=yes
        force=yes
      tags: local-repo

- hosts: elk_master
  become: yes
  roles:
    - { role: ssh-ldap, tags: [ssh-ldap] }
    - { role: elasticsearch-deps, curator_version: "4.1.1" , tags: [curator] }
    - { role: logstash, logstash_version: "1:2.4.0-1", tags: [logstash] }
    - { role: kibana, kibana_version: "4.6.0", tags: [kibana, apache] }
    - { role: apache-site, src: "elasticsearch/elk.linaro.org.conf", config: "{{inventory_hostname}}", tags: [apache] }
    - { role: apache-auth, host_name: "{{inventory_hostname}}", tags: [apache, apache-auth]}
    - { role: ansible-elasticsearch, es_instance_name: "node1", es_heap_size: "1g", tags: [elasticsearch],
    es_config: {
        cluster.name: "systems-cluster",
        discovery.zen.ping.unicast.hosts: "127.0.0.1:9300",
        http.port: 9200,
        transport.tcp.port: 9300,
        node.data: false,
        node.master: true,
        bootstrap.mlockall: false,
        discovery.zen.ping.multicast.enabled: false,
        cluster.routing.allocation.same_shard.host: false,
        index.number_of_replicas: "0",
        index.number_of_shards: "1"
        }
    }
  vars_files:
    - ["{{secrets_dir}}/host_vars/{{inventory_hostname}}"]
  vars:
    es_scripts: false
    es_templates: true
    es_templates_fileglob: "../../files/elasticsearch/templates/*"
    es_version_lock: false
    es_major_version: "2.x"
    es_version: "2.4.0"
    es_plugins_reinstall: true
    es_plugins:
     - plugin: mobz/elasticsearch-head
       version: latest
     - plugin: lmenezes/elasticsearch-kopf
       version: latest

- hosts: elk_hot
  become: yes
  roles:
    - { role: ansible-elasticsearch, es_instance_name: "node2", es_data_dirs: "/opt/elasticsearch", tags: [elasticsearch],
    es_config: {
        discovery.zen.ping.unicast.hosts: "127.0.0.1:9300",
        http.port: 9201,
        transport.tcp.port: 9301,
        node.data: true,
        node.master: false,
        bootstrap.mlockall: false,
        cluster.name: "systems-cluster",
        discovery.zen.ping.multicast.enabled: false,
        cluster.routing.allocation.same_shard.host: false,
        node.box_type: "hot"
        }
    }
  vars:
    es_scripts: false
    es_templates: false
    es_version_lock: false
    es_major_version: "2.x"
    es_version: "2.4.0"

- hosts: elk_warm
  become: yes
  roles:
    - { role: ansible-elasticsearch, es_instance_name: "node3", es_data_dirs: "/opt/elasticsearch2", tags: [elasticsearch],
    es_config: {
        discovery.zen.ping.unicast.hosts: "127.0.0.1:9300",
        http.port: 9202,
        transport.tcp.port: 9302,
        node.data: true,
        node.master: false,
        bootstrap.mlockall: false,
        cluster.name: "systems-cluster",
        discovery.zen.ping.multicast.enabled: false,
        cluster.routing.allocation.same_shard.host: false,
        node.box_type: "warm"
        }
    }
  vars:
    es_scripts: false
    es_templates: false
    es_version_lock: false
    es_major_version: "2.x"
    es_version: "2.4.0"