Commit 49fb27fd by barni2000

Fix graphite install

parent 552379f9
postactivate: postactivate:
file.managed: file.managed:
- name: /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite/bin/postactivate - name: /opt/graphite/bin/postactivate
- source: salt://graphite/files/postactivate - source: salt://graphite/files/postactivate
- template: jinja - template: jinja
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
......
...@@ -6,7 +6,7 @@ After=network.target ...@@ -6,7 +6,7 @@ After=network.target
User={{ pillar['graphite']['user'] }} User={{ pillar['graphite']['user'] }}
Group={{ pillar['graphite']['user'] }} Group={{ pillar['graphite']['user'] }}
WorkingDirectory=/opt/graphite/webapp/graphite 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 Restart=always
[Install] [Install]
......
#!/bin/bash #!/bin/bash
source /home/{{ pillar['graphite']['user'] }}/.virtualenvs/graphite/bin/activate; source /opt/graphite/bin/activate;
cd /opt/graphite/webapp/graphite/ 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_graphite:
virtualenv.managed: 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 - requirements: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- install_options:
- --prefix=/opt/graphite
- require: - require:
- virtualenv_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- file: /home/{{ pillar['graphite']['user'] }}/requirements.txt - file: /home/{{ pillar['graphite']['user'] }}/requirements.txt
- file: /opt/graphite - file: /opt/graphite
- env_vars:
global-site-packages: PYTHONPATH: '/opt/graphite/lib/:/opt/graphite/webapp/'
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
salt://graphite/files/syncdb.sh: salt://graphite/files/syncdb.sh:
cmd.script: 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