Skip to content

Commit

Permalink
Finished sensu state!
Browse files Browse the repository at this point in the history
It finally works from the ground up!
  • Loading branch information
blast-hardcheese committed Mar 19, 2012
1 parent 322b452 commit d50db41
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
9 changes: 9 additions & 0 deletions sensu/config.sls
@@ -1,3 +1,11 @@
/var/log/sensu/:
file:
- directory
- user: root
- group: root
- mode: 755
- makedirs: true

/etc/sensu/:
file:
- directory
Expand All @@ -14,3 +22,4 @@
- mode: 755
- require:
- file: /etc/sensu/
- file: /var/log/sensu/
6 changes: 5 additions & 1 deletion sensu/etc/init.d/init-template
@@ -1,5 +1,9 @@
#!/bin/sh

{% set daemon_path = salt['cmd.run']("gem contents sensu"
+ (" sensu-dashboard" if part == "sensu-dashboard" else "")
+ " | grep bin/" + part ) %}

DAEMON={{ daemon_path }}
NAME=sensu-{{ part }}
DESC="sensu {{ part }}"
Expand Down Expand Up @@ -112,7 +116,7 @@ case "$1" in
if running ; then
echo "running"
else
echo " not running."
echo "not running."
exit 1
fi
;;
Expand Down
7 changes: 2 additions & 5 deletions sensu/initscripts.sls
@@ -1,6 +1,7 @@
{% import "sensu/common.jinja" as common %}
{%- for part in common.sensu_parts %}
{%- if pillar[part] %}
{{ common.init_script_path(part) }}:
Expand All @@ -10,11 +11,7 @@
- template: jinja
- mode: 755
- defaults:
daemon_path: {{ salt['cmd.run'](
"gem contents sensu"
+ (" sensu-dashboard" if part == "sensu-dashboard" else "")
+ " | grep bin/" + part
) }}
daemon_path: "{{ salt['cmd.run'](cmd) }}"
part: "{{ part }}"
- require:
Expand Down

0 comments on commit d50db41

Please sign in to comment.