Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ sensu:
- timeout
- name: aws-sdk
version: 2.2.6
configure_rabbitmq: true
client:
embedded_ruby: true
nagios_plugins: true
redact:
- password
gem_proxy: http://192.168.1.1:3128/
configure_rabbitmq: true
rabbitmq:
host: 10.0.0.1
user: sensu
Expand Down
6 changes: 6 additions & 0 deletions sensu/api.sls
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
include:
- sensu
- sensu.api_conf
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- sensu.rabbitmq_conf
{% endif %}
- sensu.redis_conf

sensu-api:
service.running:
- enable: True
- require:
- file: /etc/sensu/conf.d/api.json
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- file: /etc/sensu/conf.d/rabbitmq.json
{% endif %}
- file: /etc/sensu/conf.d/redis.json
- watch:
- file: /etc/sensu/conf.d/api.json
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- file: /etc/sensu/conf.d/rabbitmq.json
{% endif %}
- file: /etc/sensu/conf.d/redis.json
13 changes: 13 additions & 0 deletions sensu/client.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@

include:
- sensu
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- sensu.rabbitmq_conf
{% endif %}
{% if salt['pillar.get']('sensu:transport:name') %}
- sensu.transport_conf
{% endif %}
{% if salt['pillar.get']('sensu:transport:name') == 'redis' %}
- sensu.redis_conf
{% endif %}

{% if grains['os_family'] == 'Windows' %}
/opt/sensu/bin/sensu-client.xml:
Expand Down Expand Up @@ -133,6 +141,11 @@ sensu-client:
- enable: True
- require:
- file: /etc/sensu/conf.d/client.json
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- file: /etc/sensu/conf.d/rabbitmq.json
{% endif %}
{% if salt['pillar.get']('sensu:transport:name') %}
- file: /etc/sensu/conf.d/transport.json
{% endif %}
- watch:
- file: /etc/sensu/conf.d/*
6 changes: 6 additions & 0 deletions sensu/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,9 @@ old sensu repository:
- require_in:
- pkg: sensu
{% endif %}


{% if not salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
/etc/sensu/conf.d/rabbitmq.json:
file.absent
{% endif %}
4 changes: 4 additions & 0 deletions sensu/server.sls
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
include:
- sensu
- sensu.api_conf # Some handlers need to access the API server
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- sensu.rabbitmq_conf
{% endif %}
- sensu.redis_conf

/etc/sensu/conf.d:
Expand Down Expand Up @@ -102,4 +104,6 @@ sensu-server:
- enable: True
- require:
- file: /etc/sensu/conf.d/redis.json
{% if salt['pillar.get']('sensu:server:configure_rabbitmq', True) %}
- file: /etc/sensu/conf.d/rabbitmq.json
{% endif %}