aboutsummaryrefslogtreecommitdiffstats
path: root/supporting/servers/roles/elk/tasks/main.yml
blob: 7628f378a7b7f9ea83e9820f51f241ce73a9124a (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
---
- name: adding keys
  become: true
  apt_key: keyserver=hkp://p80.pool.sks-keyservers.net id=0X58118E89F3A912897C070ADBF76221572C52609D

- name: adding entry for ubuntu
  become: true
  apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-xenial main' state=present filename='docker'
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "16.04"

- name: installing from docker repo
  become: true
  shell: apt-cache policy docker-engine
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version== "16.04"

- name: adding entry for ubuntu
  become: true
  apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main' state=present filename='docker'
  when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "14.04"

- name: updating
  become: true
  apt: update_cache=yes

- name: installing docker engine
  become: true
  apt: name=docker-engine

- name: pulling elasticsearch and kibana
  become: true
  docker_image: name={{ item }} state=present
  with_items:
    - elasticsearch
    - kibana

- name: setting up elasticsearch
  become: true
  docker_container:
    name: esearch
    image: elasticsearch
    published_ports: 9200:9200

- name: setting up kibana
  become: true
  docker_container:
    name: kibana
    image: kibana
    published_ports: 5601:5601
    links: esearch:elasticsearch

- name: nginx is installed
  become: true
  package: name=nginx state=present
- name: qtip server configuration is generated
  become: true
  template: src={{ item }}.conf.j2 dest=/etc/nginx/sites-enabled/{{ item }}.conf
  with_items:
    - elk
  notify:
    - restart nginx