Skip to content

Commit

Permalink
Merge pull request #8 from teadur/master
Browse files Browse the repository at this point in the history
Jessie carbon-cache systemd support
  • Loading branch information
nsg committed Sep 27, 2015
2 parents 75a9cd9 + af8a836 commit 2ed6e29
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ galaxy_info:
# - lenny
# - squeeze
- wheezy
- jessie
#
# Below are all categories currently available. Just as with
# the platforms above, uncomment those that apply to your role.
Expand Down
14 changes: 14 additions & 0 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,25 @@
- name: Install init.d script for carbon-cache
template: src=debian_carbon_service.j2 dest=/etc/init.d/carbon-cache
notify: restart carbon-cache
when: ansible_distribution_release == "wheesy" or ansible_distribution_release == "trusty"

- name: Install systemd unit carbon-cache.service
template: src=debian_carbon_service_systemd.j2 dest=/etc/systemd/system/carbon-cache.service
when: ansible_distribution_release == "jessie"
register: ccunit

- name: Check the install scripts perms
file: path=/etc/init.d/{{ item }} mode=0755 owner=root group=root
with_items:
- carbon-cache
when: ansible_distribution_release == "wheesy" or ansible_distribution_release == "trusty"

- name: Reload systemd if unit file has changed
shell: 'systemctl daemon-reload'
when: ccunit.changed and ansible_distribution_release == "jessie"
notify: restart carbon-cache



- name: Install uwsgi graphite config
template: src=uwsgi_graphite.ini.j2 dest=/etc/uwsgi/apps-available/graphite.ini
Expand Down
17 changes: 17 additions & 0 deletions templates/debian_carbon_service_systemd.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=carbon-cache
After=network.target

[Service]
Environment="PYTHONPATH={{ graphite_install_path }}/lib:{{ graphite_install_path }}/webapp"

# debug param seems required, otherwise carbon-cache
# just exits with code 0 and nothing is running
ExecStart={{ graphite_install_path }}/bin/carbon-cache.py --debug start
Restart=on-failure
User={{ graphite_user }}
Group={{ graphite_user }}
NoNewPrivileges=true

[Install]
WantedBy=multi-user.target

0 comments on commit 2ed6e29

Please sign in to comment.