Skip to content

Instantly share code, notes, and snippets.

@mirajavora
Created February 3, 2016 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirajavora/b85b0606591bbc8ad90e to your computer and use it in GitHub Desktop.
Save mirajavora/b85b0606591bbc8ad90e to your computer and use it in GitHub Desktop.
---
- name : Install packages
apt : name={{item}} state=present
with_items :
- python-pip
- gcc
- python-dev
tags:
- diamond
- name : Install Diamond with Pip
pip : name={{item}}
with_items:
- diamond
tags:
- diamond
- name : Create Diamond log directory
file : path={{ item }} state=directory owner={{ diamond_user }} group={{ diamond_user }}
with_items:
- /var/log/diamond/
- /etc/diamond/
tags:
- diamond
- name : Create diamond.conf file
template : src=diamond.conf dest=/etc/diamond/diamond.conf
tags:
- diamond
- name : Add custom collectors
copy : src={{ item }} dest=/usr/local/share/diamond/collectors/ owner={{ diamond_user }} group={{ diamond_user }}
with_fileglob:
- collectors/*.py
tags:
- diamond
- name : Stop Diamond
shell : killall diamond
ignore_errors: yes
tags:
- diamond
- name : Start Diamond
shell : diamond -p /var/run/diamond.pid -c /etc/diamond/diamond.conf
tags:
- diamond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment