Commit 42e3b6db by cloud

Fix graphite dependency order

parent ebe0fa54
...@@ -50,8 +50,9 @@ requirements: ...@@ -50,8 +50,9 @@ requirements:
- source: salt://graphite/files/graphite-carbon.conf - source: salt://graphite/files/graphite-carbon.conf
{% endif %} {% endif %}
/opt/graphite: opt_graphite:
file.directory: file.directory:
- name: /opt/graphite
- makedirs: True - makedirs: True
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- group: {{ pillar['graphite']['user'] }} - group: {{ pillar['graphite']['user'] }}
...@@ -66,6 +67,7 @@ requirements: ...@@ -66,6 +67,7 @@ requirements:
- template: jinja - template: jinja
- makedirs: True - makedirs: True
- require: - require:
- opt_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
/opt/graphite/conf/storage-schemas.conf: /opt/graphite/conf/storage-schemas.conf:
...@@ -76,14 +78,17 @@ requirements: ...@@ -76,14 +78,17 @@ requirements:
- group: {{ pillar['graphite']['user'] }} - group: {{ pillar['graphite']['user'] }}
- makedirs: True - makedirs: True
- require: - require:
- opt_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
/opt/graphite/webapp/graphite/local_settings.py: local_settings:
file.managed: file.managed:
- name: /opt/graphite/webapp/graphite/local_settings.py
- source: salt://graphite/files/local_settings.py - source: salt://graphite/files/local_settings.py
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- group: {{ pillar['graphite']['user'] }} - group: {{ pillar['graphite']['user'] }}
- template: jinja - template: jinja
- makedirs: True - makedirs: True
- require: - require:
- opt_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
...@@ -7,7 +7,7 @@ User={{ pillar['graphite']['user'] }} ...@@ -7,7 +7,7 @@ User={{ pillar['graphite']['user'] }}
Group={{ pillar['graphite']['user'] }} Group={{ pillar['graphite']['user'] }}
Environment=PYTHONPATH=/opt/graphite/lib GRAPHITE_ROOT=/opt/graphite Environment=PYTHONPATH=/opt/graphite/lib GRAPHITE_ROOT=/opt/graphite
WorkingDirectory=/opt/graphite/bin/ WorkingDirectory=/opt/graphite/bin/
ExecStart=/bin/bash -c "source /opt/graphite/bin/activate; exec twistd --nodaemon --reactor=epoll --no_save carbon-cache" ExecStart=/bin/bash -c "source /opt/graphite/bin/activate; source /opt/graphite/bin/postactivate; exec twistd --nodaemon --reactor=epoll --no_save carbon-cache"
Restart=always Restart=always
[Install] [Install]
......
...@@ -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 /opt/graphite/bin/activate; PYTHONPATH=/opt/graphite/lib/:/opt/graphite/webapp/ exec django-admin.py runserver [::]:8080 --settings=graphite.settings" ExecStart=/bin/bash -c "source /opt/graphite/bin/activate; source /opt/graphite/bin/postactivate; PYTHONPATH=/opt/graphite/lib/:/opt/graphite/webapp/ exec django-admin.py runserver [::]:8080 --settings=graphite.settings"
Restart=always Restart=always
[Install] [Install]
......
...@@ -3,6 +3,8 @@ virtualenv_graphite: ...@@ -3,6 +3,8 @@ virtualenv_graphite:
- name: /opt/graphite/ - name: /opt/graphite/
- system_site_packages: False - system_site_packages: False
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- require:
- opt_graphite
pip_graphite: pip_graphite:
pip.installed: pip.installed:
...@@ -24,5 +26,6 @@ salt://graphite/files/syncdb.sh: ...@@ -24,5 +26,6 @@ salt://graphite/files/syncdb.sh:
- template: jinja - template: jinja
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- require: - require:
- virtualenv: virtualenv_graphite - virtualenv_graphite
- user: {{ pillar['graphite']['user'] }} - user: {{ pillar['graphite']['user'] }}
- local_settings
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