-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yaml
43 lines (39 loc) · 958 Bytes
/
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
---
- hosts: all
become: true
handlers:
- name: restart temovex-exporter
systemd:
daemon_reload: yes
name: temovex-exporter
state: restarted
tasks:
- name: copy temovex-exporter binary
copy:
src: temovex-exporter-linux-arm7
dest: /usr/local/bin/temovex-exporter
owner: root
group: root
mode: '0755'
notify:
- restart temovex-exporter
- name: create systemd unit file
copy:
dest: /etc/systemd/system/temovex-exporter.service
content: |
[Unit]
Description=temovex-exporter
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/temovex-exporter
Environment="TEMOVEX_ADDR=192.168.3.2:26486"
Restart=always
[Install]
WantedBy=multi-user.target
notify:
- restart temovex-exporter
- name: enable service
systemd:
name: temovex-exporter
enabled: yes