Skip to content

Instantly share code, notes, and snippets.

@peterrus
Created July 2, 2017 21:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterrus/84b444e88e332fd945faa6858f32ef1a to your computer and use it in GitHub Desktop.
Save peterrus/84b444e88e332fd945faa6858f32ef1a to your computer and use it in GitHub Desktop.
Saltstate to install netdata + requirements, tries to update netdata every time this state is applied
# Saltstate to install netdata + requirements, tries to update netdata every time this state is applied
# original by https://github.com/saivert: https://github.com/firehol/netdata/issues/798#issuecomment-242472276
# modified to work on ubuntu 14.04 and 16.04 by https://github.com/peterrus
netdatarequisites:
pkg.installed:
- pkgs:
{% if grains['os'] == 'Gentoo' %}
- sys-devel/autoconf
- sys-devel/autoconf-archive
- sys-devel/automake
- sys-devel/autogen
- sys-devel/make
- net-misc/curl
- dev-vcs/git
- sys-devel/gcc
- sys-libs/zlib
- sys-apps/util-linux
- net-libs/libmnl
- net-analyzer/netcat
- dev-util/pkgconfig
{% elif grains['os'] == 'Arch' %}
- autoconf
- autoconf-archive
- automake
- autogen
- make
- git
- curl
- gcc
- zlib
- util-linux
- libmnl
- netcat
- pkgconfig
{% elif grains['os'] in ['Debian', 'Ubuntu'] %}
- autoconf
- autoconf-archive
- automake
- autogen
- make
- git
- curl
- gcc
- zlib1g-dev
- uuid-dev
- libmnl-dev
- netcat
- pkg-config
{% elif grains['os'] in ['CentOS', 'RedHat'] %}
- autoconf
- autoconf-archive
- automake
- autogen
- make
- git
- curl
- gcc
- zlib-devel
- libuuid-devel
- libmnl-devel
- nmap-ncat
- pkgconfig
{% elif grains['os'] == 'Suse' %}
- autoconf
- autoconf-archive
- automake
- autogen
- make
- git
- curl
- gcc
- zlib-devel
- libuuid-devel
- libmnl0
- netcat-openbsd
- pkg-config
{% endif %}
netdatarepo:
git.latest:
- name: https://github.com/firehol/netdata.git
- depth: 1
- target: /root/netdatagit
- force_reset: True
netdatainstall:
require:
- git: netdatarepo
- pkg: netdatarequisites
cmd.run:
- cwd: /root/netdatagit
- name: ./netdata-installer.sh
#- output_loglevel: quiet #disable this to get verbose output of the compilation/installation process
- unless: test -f ./netdata-updater.sh
netdataupdate:
require:
- cmd: netdatainstall
cmd.run:
- cwd: /root/netdatagit
- name: ./netdata-updater.sh
- onlyif: test -f ./netdata-updater.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment