Commit c40ce832 by barni2000 Committed by barni2000

Fix graphite install

parent 26b7ba4b
postactivate:
file.managed:
- name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite/bin/postactivate
- name: /opt/graphite/bin/postactivate
- source: salt://graphite/files/postactivate
- template: jinja
- user: {{ pillar['graphite']['user'] }}
......
......@@ -6,7 +6,7 @@ After=network.target
User={{ pillar['graphite']['user'] }}
Group={{ pillar['graphite']['user'] }}
WorkingDirectory=/opt/graphite/webapp/graphite
ExecStart=/bin/bash -c "source /etc/profile; workon graphite; PYTHONPATH=/opt/graphite/webapp exec django-admin.py runserver [::]:8081 --settings=graphite.settings"
ExecStart=/bin/bash -c "source /etc/profile; source /opt/graphite/bin/activate; PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/" exec django-admin.py runserver [::]:8081 --settings=graphite.settings"
Restart=always
[Install]
......
#!/bin/bash
source /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite/bin/activate;
source /opt/graphite/bin/activate;
cd /opt/graphite/webapp/graphite/
PYTHONPATH=/opt/graphite/webapp django-admin.py syncdb --settings=graphite.settings --noinput
PYTHONPATH="/opt/graphite/lib/:/opt/graphite/webapp/" django-admin.py migrate --settings=graphite.settings --noinput
virtualenv_graphite:
virtualenv.managed:
- name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite
- name: /opt/graphite/
- system_site_packages: False
- user: {{ pillar['graphite']['user'] }}
pip_graphite:
pip.installed:
- bin_env: /opt/graphite/bin/pip
- requirements: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- user: {{ pillar['graphite']['user'] }}
- install_options:
- --prefix=/opt/graphite
- require:
- virtualenv_graphite
- user: {{ pillar['graphite']['user'] }}
- file: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- file: /opt/graphite
global-site-packages:
file.absent:
- name: /home/{{pillar['graphite']['user'] }}/.virtualenvs/graphite/lib/python2.7/no-global-site-packages.txt
- require:
- virtualenv: virtualenv_graphite
unicode-fix-diff:
file.managed:
- name: /home/{{pillar['graphite']['user'] }}/graphite-unicode-fix.diff
- template: jinja
- source: salt://graphite/files/graphite-unicode-fix.diff
- user: {{ pillar['graphite']['user'] }}
- group: {{ pillar['graphite']['user'] }}
unicode-fix:
cmd.run:
- user: {{ pillar['graphite']['user'] }}
- cwd: /opt/graphite/webapp/graphite
- name: patch -N -p1 < /home/{{pillar['graphite']['user'] }}/graphite-unicode-fix.diff
- onlyif: patch -N --dry-run --silent -p1 < /home/{{pillar['graphite']['user'] }}/graphite-unicode-fix.diff
- require:
- virtualenv: virtualenv_graphite
- user: {{ pillar['graphite']['user'] }}
- file: unicode-fix-diff
- env_vars:
PYTHONPATH: '/opt/graphite/lib/:/opt/graphite/webapp/'
salt://graphite/files/syncdb.sh:
cmd.script:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment