-
-
Save littlespace/ec03849bdce40111451c8acb5f305ee7 to your computer and use it in GitHub Desktop.
Saltstack state files for deploying TICK stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lvm2: | |
pkg.installed: [] | |
/dev/sdb: | |
lvm.pv_present: | |
- require: | |
- pkg: lvm2 | |
DATA: | |
lvm.vg_present: | |
- devices: /dev/sdb | |
MAIN: | |
lvm.lv_present: | |
- vgname: DATA | |
- size: 45G | |
/dev/DATA/MAIN: | |
blockdev.formatted: | |
- fs_type: ext4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set os = grains.get('os')|lower %} | |
/var/lib/influxdb: | |
mount.mounted: | |
- device: /dev/DATA/MAIN | |
- fstype: ext4 | |
- persist: True | |
- mkmnt: True | |
influxdb: | |
pkg.installed: | |
- require: | |
- pkgrepo: tick_repo | |
service.running: | |
- name: influxdb | |
- enable: True | |
- watch: | |
- file: /etc/influxdb/influxdb.conf | |
/etc/influxdb/influxdb.conf: | |
file.managed: | |
- source: salt://influxdb/influxdb.jinja | |
- template: jinja | |
create_telegraf_db: | |
cmd.run: | |
- name: influx -execute "CREATE DATABASE telegraf" | |
- unless: influx -execute "SHOW DATABASES" | grep telegraf | |
grafana: | |
pkgrepo.managed: | |
- humanname: Grafana repository | |
- name: deb https://packagecloud.io/grafana/stable/{{ os }}/ {{ grains['oscodename']}} main | |
- file: /etc/apt/sources.list.d/grafana.list | |
- key_url: https://packagecloud.io/gpg.key | |
- clean_file: true | |
pkg.latest: | |
- name: grafana | |
- refresh: True | |
service.running: | |
- name: grafana-server | |
- enable: True | |
- watch: | |
- file: /etc/grafana/grafana.ini | |
/etc/grafana/grafana.ini: | |
file.managed: | |
- source: salt://influxdb/grafana.jinja | |
- template: jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set os = grains.get('os')|lower %} | |
basic.packages: | |
pkg.installed: | |
- pkgs: | |
- vim | |
- htop | |
- tmux | |
- git | |
- apt-transport-https | |
/etc/vimrc: | |
file.managed: | |
- source: salt://software/vimrc | |
tick_repo: | |
pkgrepo.managed: | |
- humanname: TICK stack repository from Influxdata | |
- name: deb https://repos.influxdata.com/{{ os }} {{ grains['oscodename']}} stable | |
- key_url: https://repos.influxdata.com/influxdb.key | |
- file: /etc/apt/sources.list.d/influxdata.list | |
- clean_file: True | |
telegraf: | |
pkg.installed: | |
- refresh: True | |
service.running: | |
- name: telegraf | |
- enable: True | |
- watch: | |
- file: /etc/telegraf/telegraf.conf | |
/etc/telegraf/telegraf.conf: | |
file.managed: | |
- source: salt://software/telegraf.jinja | |
- template: jinja |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# THIS FILE IS MANAGED BY SALT | |
# | |
[agent] | |
hostname = "{{ grains['fqdn'] }}" | |
omit_hostname = false | |
interval = "10s" | |
round_interval = true | |
metric_buffer_limit = 1000 | |
flush_buffer_when_full = true | |
collection_jitter = "0s" | |
flush_interval = "60s" | |
flush_jitter = "0s" | |
debug = false | |
quiet = false | |
# | |
# OUTPUTS: | |
# | |
[[outputs.influxdb]] | |
database = "telegraf" | |
urls = ["http://1.2.3.4:8086"] | |
# | |
# INPUTS: | |
# | |
[[inputs.cpu]] | |
percpu = true | |
totalcpu = true | |
[[inputs.disk]] | |
ignore_fs = ["tmpfs", "devtmpfs"] | |
[[inputs.diskio]] | |
[[inputs.kernel]] | |
[[inputs.mem]] | |
[[inputs.net]] | |
[[inputs.netstat]] | |
[[inputs.processes]] | |
[[inputs.swap]] | |
[[inputs.system]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment