mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-28 20:07:00 +02:00
4cc100ab02
This changes the site to run on Debian 10 instead of Ubuntu 16.04. It also fully converts the previous Salt setup to use Ansible instead. Most of this was a relatively straightforward conversion, and it should be very close to equivalent. One notable difference is that I removed the setup for the "monitoring" server, since I wasn't confident that the way of setting up self-hosted Sentry and Grafana was working any more. I'll look to re-add that at some point, but it's not urgent.
43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
---
|
|
- name: Create prometheus user and group
|
|
import_tasks: prometheus_user.yml
|
|
|
|
- name: Download node_exporter from GitHub
|
|
get_url:
|
|
dest: /tmp/prometheus_node_exporter.tar.gz
|
|
url: https://github.com/prometheus/node_exporter/releases/download/v0.13.0/node_exporter-0.13.0.linux-amd64.tar.gz
|
|
checksum: sha256:2de5d1e51330c41588ed4c88bc531a3d2dccf6b4d7b99d5782d95cff27a3c049
|
|
|
|
- name: Create node_exporter directory
|
|
file:
|
|
path: /opt/prometheus_node_exporter
|
|
state: directory
|
|
owner: prometheus
|
|
group: prometheus
|
|
mode: 0755
|
|
|
|
- name: Extract node_exporter
|
|
unarchive:
|
|
remote_src: true
|
|
src: /tmp/prometheus_node_exporter.tar.gz
|
|
dest: /opt/prometheus_node_exporter
|
|
owner: prometheus
|
|
group: prometheus
|
|
extra_opts:
|
|
- --strip-components=1
|
|
creates: /opt/prometheus_node_exporter/node_exporter
|
|
|
|
- name: Create node_exporter service file
|
|
copy:
|
|
src: prometheus_node_exporter.service
|
|
dest: /etc/systemd/system/prometheus_node_exporter.service
|
|
owner: root
|
|
group: root
|
|
mode: 0644
|
|
|
|
- name: Start and enable node_exporter service
|
|
service:
|
|
name: prometheus_node_exporter
|
|
state: started
|
|
enabled: true
|