Example Infrastructure Layout
This document showcases an example layout for use with the Sensu role within your infrastructure. It ties in with use of inventory grouping and variables.
Inventory & Variables
Let's start with an example Ansible Inventory:
[sensu_rabbitmq_servers] test.cmacr.ae [sensu_redis_servers] redis.cmacr.ae [sensu_masters] sensu.cmacr.ae [webservers] blog.cmacr.ae web.cmacr.ae sab.cmacr.ae tater.cmacr.ae beardy.cmacr.ae pkgsrc.cmacr.ae [zones] ansible.cmacr.ae beardy.cmacr.ae blog.cmacr.ae bunny.cmacr.ae git.cmacr.ae irc.cmacr.ae pkgsrc.cmacr.ae redis.cmacr.ae sab.cmacr.ae sensu.cmacr.ae tater.cmacr.ae web.cmacr.ae test.cmacr.ae
Here we have some nodes grouped into
Since we only want one Sensu "master", the default to act as a master in this role is set to
false - defined by
There are several ways to approach setting
true for the node you'd like to act as the Sensu "master".
Personally, I do this by setting the following in
sensu_master: true sensu_include_dashboard: true
You can see I decided I want the Uchiwa dashboard to be deployed also, so I set
The above code could also be set straight in the node's
host_vars/sensu.cmacr.ae.yml or set straight in a playbook intended just for the
- hosts: sensu_masters vars: sensu_master: true sensu_include_dashboard: true roles: - sensu.sensu
You'll probably have noticed the two groups
sensu_redis_servers in the example inventory.
Quite self explanatory what these are, but - as with the
sensu_master variable in the previous section - both the
sensu_redis_server values are set to
false by default (defined in
The same approach of setting these to
true is taken here again.
Once more, I opt to set these in
group_vars, like so:
The same can, again, be set directly in your RabbitMQ/redis nodes'
host_vars files, or done so in the playbook as shown in the previous section for the values