Update graphite states

This commit is contained in:
Antsiferov Grigory 2018-09-09 10:02:43 +03:00
parent e72a564824
commit 380f8a034a
4 changed files with 33 additions and 26 deletions

View File

@ -1,2 +1,8 @@
include:
- gentoo.makeconf
dev-python/carbon:
pkg.latest
pkg.installed:
- version: ">=1.1.3-r1"
- require:
- augeas: manage-make-conf

View File

@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<uwsgi>
<plugins>python27</plugins>
<master/>
<single-interpreter/>
<!-- TODO: take number of processes from some variable -->
<processes>${processes}</processes>
<socket>${socket}</socket>
% if # startswith?
<chown-socket>nginx:nginx</chown-socket>
<chmod-socket>640</chmod-socket>
% endif
<user>carbon</user>
<uid>carbon</uid>
<chdir>/etc/%n</chdir>
<harakiri>120</harakiri>
<post-buffering>8192</post-buffering>
<post-buffering-bufsize>65536</post-buffering-bufsize>
<env>DJANGO_SETTINGS_MODULE=graphite.settings</env>
<module>wsgi</module>
</uwsgi>

View File

@ -1,10 +1,13 @@
{% set uwsgi_conf = salt['pillar.get']('graphite-web:uwsgi', {}) %}
{% set uwsgi_plugins = uwsgi_conf.get('plugins', 'python36') %}
{% set uwsgi_processes = uwsgi_conf.get('processes', salt['grains.get']('num_cpus', 2)) %}
include:
- python.dev-python.django-tagging
- uwsgi
net-analyzer/graphite-web:
pkg.installed:
- version: '~>=0.9.13-r3[carbon,memcached,mysql]'
- version: '~>=1.1.3-r1[carbon,memcached,mysql]'
- require:
- pkg: dev-python/django-tagging
@ -23,10 +26,26 @@ net-analyzer/graphite-web:
- user: root
- group: root
/etc/uwsgi.d/graphite-web.xml:
/etc/uwsgi.d/graphite-web.ini:
file.managed:
- source: salt://graphite/files/uwsgi.xml.tpl
- template: mako
- mode: 644
- user: root
- group: root
- contents: |
[uwsgi]
plugins={{ uwsgi_plugins }}
master=true
single-interpreter=true
processes={{ uwsgi_processes }}
harakiri=120
post-buffering=8192
post-buffering-bufsize=65536
socket=/run/%n.sock
# TODO: take number of processes from some variable
chown-socket=nginx:nginx
chmod-socket=640
user=carbon
uid=carbon
chdir=/etc/%n
env=DJANGO_SETTINGS_MODULE=graphite.settings
module=wsgi

3
sls/graphite/init.sls Normal file
View File

@ -0,0 +1,3 @@
include:
- graphite.carbon-cache
- graphite.graphite-web