jtyr.sensu
sensu
Ansible role to install and configure Sensu and Uchiwa dashboard.
The configuration of the role is done in such way that it should not be necessary to change the role for any kind of configuration. All can be done either by changing role parameters or by declaring completely new configuration as a variable. That makes this role absolutely universal. See the examples below for more details.
Please report any issues or send PR.
Examples
---
# Server installation
- hosts: my_sensu_server
roles:
- rabbitmq
- redis
- uchiwa
- role: sensu
sensu_install_server: yes
sensu_install_api: yes
# Client installation
- hosts: my_client1
vars:
server__sensu: my_sensu_server
roles:
- role: sensu
vars:
sensu_api_host: "{{ server__sensu }}"
sensu_rabbitmq_host: "{{ server__sensu }}"
sensu_redis_host: "{{ server__sensu }}"
Role variables
List of variables used by the role:
# YUM repo URL
sensu_yumrepo_url: http://repos.sensuapp.org/yum/el/$releasever/$basearch/
# Custom YUM repo params
sensu_yumrepo_params: {}
# Package to be installed (you can force a specific version here)
sensu_pkg: sensu
# This allows to change the name of handlers (must be passed to the role)
# (handy if the role is used multiple times and skipped on one of the places)
sensu_from: "(default)"
# Variables for installation of client/server
sensu_install_server: false
sensu_install_api: false
sensu_install_client: true
# Default sensu-server config variables for RabbitMQ
sensu_rabbitmq_host: localhost
sensu_rabbitmq_port: 5671
sensu_rabbitmq_user: sensu
sensu_rabbitmq_password: sensu
sensu_rabbitmq_vhost: /sensu
# Default sensu-server options from RabbitMQ
sensu_rabbitmq__default:
host: "{{ sensu_rabbitmq_host }}"
port: "{{ sensu_rabbitmq_port }}"
user: "{{ sensu_rabbitmq_user }}"
password: "{{ sensu_rabbitmq_password }}"
vhost: "{{ sensu_rabbitmq_vhost }}"
# Custom sensu-server options from RabbitMQ
sensu_rabbitmq__custom: {}
# Default sensu-server config variables for Redis
sensu_redis_host: localhost
sensu_redis_port: 6379
# Default sensu-server options from Redis
sensu_redis__default:
host: "{{ sensu_redis_host }}"
port: "{{ sensu_redis_port }}"
# Custom sensu-server options from Redis
sensu_redis__custom: {}
# Default sensu-server config variables for Sensu API
sensu_api_host: localhost
sensu_api_port: 4567
# Default sensu-server options from Sensu API
sensu_api__default:
host: "{{ sensu_api_host }}"
port: "{{ sensu_api_port }}"
# Custom sensu-server options from Sensu API
sensu_api__custom: {}
# Default sensu-server config variables for Sensu Handlers
sensu_handlers_default_type: pipe
sensu_handlers_default_command: " true"
# Default sensu-server options from Sensu Handlers
sensu_handlers__default:
default:
type: "{{ sensu_handlers_default_type }}"
command: "{{ sensu_handlers_default_command }}"
# Custom sensu-server options from Sensu Handlers
sensu_handlers__custom: {}
# Default sensu-server config
sensu_config__default:
rabbitmq: "{{
sensu_rabbitmq__default.update(sensu_rabbitmq__custom) }}{{
sensu_rabbitmq__default }}"
redis: "{{
sensu_redis__default.update(sensu_redis__custom) }}{{
sensu_redis__default }}"
api: "{{
sensu_api__default.update(sensu_api__custom) }}{{
sensu_api__default }}"
handlers: "{{
sensu_handlers__default.update(sensu_handlers__custom) }}{{
sensu_handlers__default }}"
# Custom sensu-server config
sensu_config__custom: {}
# Final sensu-server config
sensu_config: "{{
sensu_config__default.update(sensu_config__custom) }}{{
sensu_config__default }}"
# Default sensu-client client config values
sensu_client_name: "{{ ansible_hostname }}"
sensu_client_address: "{{ ansible_default_ipv4.address }}"
sensu_client_subscriptions:
- test
# Default sensu-client client config options
sensu_client_client__default:
name: "{{ sensu_client_name }}"
address: "{{ sensu_client_address }}"
subscriptions: "{{ sensu_client_subscriptions }}"
# Custom sensu-client config options
sensu_client_client__custom: {}
# Default sensu-client config options
sensu_client__default:
client: "{{
sensu_client_client__default.update(sensu_client_client__custom) }}{{
sensu_client_client__default }}"
# Custom sensu-client config options
sensu_client__custom: {}
# Final sensu-client config
sensu_client_config: "{{
sensu_client__default.update(sensu_client__custom) }}{{
sensu_client__default }}"
# Default options for the rabitmq section of the RabbitMQ config for Sensu client
sensu_client_rabbitmq_rabbitmq__default:
host: "{{ sensu_rabbitmq_host }}"
port: "{{ sensu_rabbitmq_port }}"
user: "{{ sensu_rabbitmq_user }}"
password: "{{ sensu_rabbitmq_password }}"
vhost: "{{ sensu_rabbitmq_vhost }}"
# Custom options for the rabitmq section of the RabbitMQ config for Sensu client
sensu_client_rabbitmq_rabbitmq__custom: {}
# Default options for the RabbitMQ config for Sensu client
sensu_client_rabbitmq__default:
rabbitmq: "{{
sensu_client_rabbitmq_rabbitmq__default.update(sensu_client_rabbitmq_rabbitmq__custom) }}{{
sensu_client_rabbitmq_rabbitmq__default }}"
# Custom options for the RabbitMQ config for Sensu client
sensu_client_rabbitmq__custom: {}
# Final RabbitMQ config for Sensu client
sensu_client_rabbitmq_config: "{{
sensu_client_rabbitmq__default.update(sensu_client_rabbitmq__custom) }}{{
sensu_client_rabbitmq__default }}"
Dependencies
config_encoder_filtersrabbitmqrole (optional)redisrole (optional)uchiwarole (optional)
License
MIT
Author
Jiri Tyr
Install
ansible-galaxy install jtyr.sensuLicense
mit
Downloads
87
Owner
DevOps Engineer
