-
Notifications
You must be signed in to change notification settings - Fork 0
/
metricbeat-playbook.yaml
76 lines (58 loc) · 1.69 KB
/
metricbeat-playbook.yaml
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
---
- name: "Install Golang"
hosts: all
become: yes
tasks:
- name: remove previous golangs version
apt:
name: golang
state: absent
update_cache: true
- name: get golang 1.8 files
get_url:
url: https://storage.googleapis.com/golang/go1.8.linux-armv6l.tar.gz
dest: /home/pi/
- name: unarchive golang tarball
command: tar -C /usr/local -xzf /home/pi/go1.8.linux-armv6l.tar.gz
- name: export PATH
shell: export PATH=~/go
- name: install golang 1.8
apt:
name: golang
update_cache: true
- name: install virtualenv
pip:
name: virtualenv
- name: "Increase SWAP size"
hosts: all
become: yes
tasks:
- name: set golang path variable
shell: export GOPATH=/usr/local/go/bin
- name: edit config file
lineinfile:
dest: /etc/dphys-swapfile
regexp: '^(.*)CONF_SWAPSIZE=100(.*)$'
line: 'CONF_SWAPSIZE=1024'
backrefs: yes
- name: reload config
shell: dphys-swapfile setup && dphys-swapfile swapon
- name: "Install Metricbeat"
hosts: all
become: yes
tasks:
- name: get sources
shell: /usr/local/go/bin/go get github.com/elastic/beats
ignore_errors: yes
- name: checkout version branch
shell: git checkout 6.0
args:
chdir: ~/go/src/github.com/elastic/beats/metricbeat
- name: build metricbeat from source
shell: GOPATH=~/go make
args:
chdir: ~/go/src/github.com/elastic/beats/metricbeat/
- name: test metricbeat
shell: ./metricbeat -e
args:
chdir: ~/go/src/github.com/elastic/beats/metricbeat/