forked from ncabatoff/zfs-exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook-zfs-exporter.yml
29 lines (29 loc) · 980 Bytes
/
playbook-zfs-exporter.yml
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
---
- hosts: all
become_user: root
become: true
vars:
zfs_exporter_bin: /root/src/github.com/ncabatoff/zfs-exporter/zfs-exporter/zfs-exporter
zfs_exporter_port: 9254
roles:
- role: gantsign.golang
tasks:
- name: checkout zfs-exporter
git:
repo: https://github.com/ncabatoff/zfs-exporter.git
dest: /root/src/github.com/ncabatoff/zfs-exporter
- name: install zfs-exporter
command: env GOROOT={{ golang_install_dir }} GOPATH=/root {{ golang_install_dir }}/bin/go build
args:
chdir: /root/src/github.com/ncabatoff/zfs-exporter/zfs-exporter
creates: "{{ zfs_exporter_bin }}"
- name: create zfs-exporter systemd service file
template:
src: templates/zfs-exporter.service.j2
dest: /etc/systemd/system/zfs-exporter.service
- name: start zfs-exporter service
systemd: name=zfs-exporter state=restarted daemon_reload=yes
- wait_for:
port: "{{ zfs_exporter_port }}"
delay: 1
timeout: 10