Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
9 changes: 9 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,25 @@ 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
password: secret
redis:
host: 10.0.0.1
port: 6379
reconnect_on_error: True
sentinels:
- host: localhost
port: 26379
api:
password: secret
ssl:
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
15 changes: 14 additions & 1 deletion 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 @@ -52,7 +60,7 @@ sensu_standalone_checks_file:
client:
name: {{ sensu.client.name }}
address: {{ sensu.client.address }}
subscriptions: {{ sensu.client.subscriptions }}
subscriptions: {{ sensu.client.subscriptions + pillar.get('role', []) }}
safe_mode: {{ sensu.client.safe_mode }}
{% if sensu.client.get('keepalive') %}
keepalive: {{ sensu.client.keepalive }}
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 %}
2 changes: 1 addition & 1 deletion sensu/redis_conf.sls
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
host: {{ sensu.redis.host }}
{% if sensu.redis.password is defined and sensu.redis.password is not none %}password: {{ sensu.redis.password }}{% endif %}
port: {{ sensu.redis.port }}

{% if sensu.redis.sentinels is defined and sensu.redis.sentinels is not none %}sentinels: {{ sensu.redis.sentinels }}{% 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 %}