Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
salt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
17
Merge Requests
1
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
54c0b2d4
authored
Jul 21, 2018
by
barni2000
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cherry-pick-
49fb27fd
' into 'graphite-fix'
Fix graphite install See merge request
!11
parents
26b7ba4b
c40ce832
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
31 deletions
+17
-31
salt/graphite/configuration.sls
+1
-1
salt/graphite/files/graphite.service
+1
-1
salt/graphite/files/requirements.txt
+1
-1
salt/graphite/files/syncdb.sh
+2
-2
salt/graphite/virtualenv.sls
+12
-26
No files found.
salt/graphite/configuration.sls
View file @
54c0b2d4
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'] }}
...
...
salt/graphite/files/graphite.service
View file @
54c0b2d4
...
...
@@ -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]
...
...
salt/graphite/files/requirements.txt
View file @
54c0b2d4
Django
==1.
7
Django
==1.
11
Twisted
<12.0
python-memcached
txAMQP
...
...
salt/graphite/files/syncdb.sh
View file @
54c0b2d4
#!/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
salt/graphite/virtualenv.sls
View file @
54c0b2d4
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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment