瀏覽代碼

fix(issues) Attempt to address #16

This is an attempt at #16. It has breaking changes if merged due to the variables and group namges changing.
Michael Porter 6 年之前
父節點
當前提交
0d80939ea1

+ 21 - 21
defaults/main.yml

@@ -30,29 +30,29 @@ sensu_deploy_rabbitmq_server: true
 sensu_deploy_redis_server: true
 
 # RabbitMQ server properties
-rabbitmq_config_path: /etc/rabbitmq
-rabbitmq_config_template: rabbitmq.config.j2
-rabbitmq_enable_ssl: true
-rabbitmq_host: "{{ groups['rabbitmq_servers'][0] }}"
-rabbitmq_port: 5671
-rabbitmq_pkg_state: present
-rabbitmq_server: false
-rabbitmq_service_name: rabbitmq-server
-rabbitmq_sensu_user_name: sensu
-rabbitmq_sensu_password: sensu
-rabbitmq_sensu_vhost: /sensu
+sensu_rabbitmq_config_path: /etc/rabbitmq
+sensu_rabbitmq_config_template: rabbitmq.config.j2
+sensu_rabbitmq_enable_ssl: true
+sensu_rabbitmq_host: "{{ groups['rabbitmq_servers'][0] }}"
+sensu_rabbitmq_port: 5671
+sensu_rabbitmq_pkg_state: present
+sensu_rabbitmq_server: false
+sensu_rabbitmq_service_name: rabbitmq-server
+sensu_rabbitmq_sensu_user_name: sensu
+sensu_rabbitmq_sensu_password: sensu
+sensu_rabbitmq_sensu_vhost: /sensu
 
 # redis server properties
-redis_host: "{{ groups['redis_servers'][0] }}"
-redis_server: false
-redis_service_name: redis
-redis_pkg_repo: ~
-redis_pkg_name: redis
-redis_pkg_state: present
-redis_port: 6379
-redis_password:
-redis_sentinels: []
-redis_master_name:
+sensu_redis_host: "{{ groups['sensu_redis_servers'][0] }}"
+sensu_redis_server: false
+sensu_redis_service_name: redis
+sensu_redis_pkg_repo: ~
+sensu_redis_pkg_name: redis
+sensu_redis_pkg_state: present
+sensu_redis_port: 6379
+sensu_redis_password:
+sensu_redis_sentinels: []
+sensu_redis_master_name:
 sensu_redis_config: sensu-redis.json.j2
 
 # Sensu/Uchiwa user/group/service properties

+ 10 - 10
docs/dynamic_checks.md

@@ -21,9 +21,9 @@ $ tree data/static
 data/static
 `-- sensu
     |-- checks
-    |   |-- rabbitmq_servers
+    |   |-- sensu_rabbitmq_servers
     |   |   `-- check_rabbitmq.sh
-    |   |-- redis_servers
+    |   |-- sensu_redis_servers
     |   |   `-- check_redis.sh
     |   |-- webservers
     |   |   `-- check_nginx.sh
@@ -41,7 +41,7 @@ data/static
     |   |-- smartos_check_disk.json.j2
     |   `-- smartos_check_mem.json.j2
     |-- client_definitions
-    |   |-- rabbitmq_servers
+    |   |-- sensu_rabbitmq_servers
     |   |   `-- check_users.json.j2
     |   `-- webservers
     |       `-- check_uptime.json.j2
@@ -49,13 +49,13 @@ data/static
     |   `-- pushover.rb
     `-- mutators
 ```
-As you can see, in the `sensu/checks` directory, there are the `rabbitmq_servers`, `redis_servers`, `webservers` & `zones` subdirectories.
+As you can see, in the `sensu/checks` directory, there are the `sensu_rabbitmq_servers`, `sensu_redis_servers`, `webservers` & `zones` subdirectories.
 If you've had a peruse through some of the other documentation here, you'll know that these groups are defined within my Ansible inventory:
 ``` ini
-[rabbitmq_servers]
+[sensu_rabbitmq_servers]
 test.cmacr.ae
 
-[redis_servers]
+[sensu_redis_servers]
 redis.cmacr.ae
 
 [sensu_masters]
@@ -85,7 +85,7 @@ web.cmacr.ae
 test.cmacr.ae
 ```
 Under these subdirectories, you can see [checks](https://docs.sensu.io/sensu-core/latest/reference/checks/) that relate to the directory they're placed in.
-For example, our `webservers` subdirectory includes a `check_nginx.sh` script, whilst the `rabbitmq_servers` subdirectory has one that most likely checks for RabbitMQ problems (it does... trust me).
+For example, our `webservers` subdirectory includes a `check_nginx.sh` script, whilst the `sensu_rabbitmq_servers` subdirectory has one that most likely checks for RabbitMQ problems (it does... trust me).
 
 So how do these checks actually get deployed to their associated nodes?
 With this pair of plays, in the `tasks/plugins.yml` playbook:
@@ -147,10 +147,10 @@ In your Ansible inventory, after this spontaneous decision to have your webserve
 [webservers]
 mime.domain.name
 
-[redis_servers]
+[sensu_redis_servers]
 mime.domain.name
 ```
-Not to worry, the next time your playbook applying this Sensu role runs through (notably the `tasks/client.yml` & `tasks/plugins.yml` playbooks), the new checks for redis will be deployed to `mime.domain.name` and it'll be subscribed to the `redis_servers` stream within Sensu. Pretty slick, right?
+Not to worry, the next time your playbook applying this Sensu role runs through (notably the `tasks/client.yml` & `tasks/plugins.yml` playbooks), the new checks for redis will be deployed to `mime.domain.name` and it'll be subscribed to the `sensu_redis_servers` stream within Sensu. Pretty slick, right?
 
 The same goes for the removal of a node from a group. Did you just realize you really don't want `mime.domain.name` to act as a redis server?
-It's cool, we all make mistakes, just take him out of the `[redis_servers]` group in your inventory. When your play comes through again, applying this Sensu role, he'll be unsubscribed from the `redis_servers` stream, and redis'll stop being monitored!
+It's cool, we all make mistakes, just take him out of the `[sensu_redis_servers]` group in your inventory. When your play comes through again, applying this Sensu role, he'll be unsubscribed from the `sensu_redis_servers` stream, and redis'll stop being monitored!

+ 1 - 1
docs/dynamic_data.md

@@ -72,7 +72,7 @@ The same method is used for node communication with RabbitMQ:
   - name: Ensure RabbitMQ SSL certs/keys are in place
     copy:
 	  src: "{{ item }}"
-	  dest: "{{ rabbitmq_config_path }}/ssl"
+	  dest: "{{ sensu_rabbitmq_config_path }}/ssl"
     loop:
       - "{{ sensu_ssl_server_cacert }}"
       - "{{ sensu_ssl_server_cert }}"

+ 9 - 9
docs/example_infra.md

@@ -9,10 +9,10 @@ It ties in with use of inventory grouping and variables.
 Let's start with an example Ansible Inventory:
 
 ``` ini
-[rabbitmq_servers]
+[sensu_rabbitmq_servers]
 test.cmacr.ae
 
-[redis_servers]
+[sensu_redis_servers]
 redis.cmacr.ae
 
 [sensu_masters]
@@ -42,7 +42,7 @@ web.cmacr.ae
 test.cmacr.ae
 ```
 
-Here we have some nodes grouped into `rabbitmq_servers`, `redis_servers`, `sensu_masters`, `webservers`, and `zones`.
+Here we have some nodes grouped into `sensu_rabbitmq_servers`, `sensu_redis_servers`, `sensu_masters`, `webservers`, and `zones`.
 
 Since we only want one Sensu "master", the default to act as a master in this role is set to `false` - defined by `sensu_master`.
 
@@ -65,20 +65,20 @@ The above code could also be set straight in the node's `host_vars` file: `host_
 ```
 
 ### RabbitMQ/redis variables
-You'll probably have noticed the two groups `rabbitmq_servers` and `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 `rabbitmq_server` & `redis_server` values are set to `false` by default (defined in `defaults/main.yml`).
+You'll probably have noticed the two groups `sensu_rabbitmq_servers` and `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_rabbitmq_server` & `sensu_redis_server` values are set to `false` by default (defined in `defaults/main.yml`).
 
 The same approach of setting these to `true` is taken here again.
 Once more, I opt to set these in `group_vars`, like so:
 
-`group_vars/rabbitmq_servers.yml`
+`group_vars/sensu_rabbitmq_servers.yml`
 ``` yaml
-rabbitmq_server: true
+sensu_rabbitmq_server: true
 ```
 
-`group_vars/redis_servers.yml`
+`group_vars/sensu_redis_servers.yml`
 ``` yaml
-redis_server: true
+sensu_redis_server: true
 ```
 
 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 `sensu_master` & `sensu_include_dashboard`.

+ 9 - 9
docs/integration.md

@@ -1,18 +1,18 @@
 Integration with other roles/management methods
 ===============================================
-Although this role can deploy and manage the full Sensu stack, you can opt to use other roles to manage RabbitMQ, redis, and the Uchiwa dashboard, if you so desire.  
+Although this role can deploy and manage the full Sensu stack, you can opt to use other roles to manage RabbitMQ, redis, and the Uchiwa dashboard, if you so desire.
 
 RabbitMQ
 --------
 If you'd like to use a different role/management method for RabbitMQ, the following variables are of interest:
 ``` yaml
 sensu_deploy_rabbitmq_server: false
-rabbitmq_host: < IP/DNS record of your RabbitMQ server >
-rabbitmq_port: < optionally set a differing port, defaults to 5671 >
-rabbitmq_sensu_user_name: < the username for interacting with RabbitMQ >
-rabbitmq_sensu_password: < the password for interacting with RabbitMQ >
-rabbitmq_sensu_vhost: < the RabbitMQ vhost to use, defaults to '/sensu' >
-rabbitmq_config_path: < the path to the RabbitMQ configuration >
+sensu_rabbitmq_host: < IP/DNS record of your RabbitMQ server >
+sensu_rabbitmq_port: < optionally set a differing port, defaults to 5671 >
+sensu_rabbitmq_sensu_user_name: < the username for interacting with RabbitMQ >
+sensu_rabbitmq_sensu_password: < the password for interacting with RabbitMQ >
+sensu_rabbitmq_sensu_vhost: < the RabbitMQ vhost to use, defaults to '/sensu' >
+sensu_rabbitmq_config_path: < the path to the RabbitMQ configuration >
 
 ```
 
@@ -23,8 +23,8 @@ redis
 If you'd like to use a different role/management method for redis, the following variables are of interest:
 ``` yaml
 sensu_deploy_redis_server: false
-redis_host: < IP/DNS record of your redis server >
-redis_port: < optionally set a differing port, defaults to 6379 >
+sensu_redis_host: < IP/DNS record of your redis server >
+sensu_redis_port: < optionally set a differing port, defaults to 6379 >
 ```
 
 Uchiwa dashboard

+ 29 - 29
docs/role_variables.md

@@ -12,31 +12,31 @@ _Note: The above options are intended to provide users with flexibility. This al
 ### [RabbitMQ Server Properties](https://docs.sensu.io/sensu-core/latest/reference/rabbitmq/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `rabbitmq_config_path` | `/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
-| `rabbitmq_config_template` | `rabbitmq.config.j2` | The template to use for the RabbitMQ service configuration |
-|` rabbitmq_host` | `"{{ groups\['rabbitmq_servers']\[0] }}"` | The hostname/IP address of the RabbitMQ node |
-| `rabbitmq_port` | 5671 | The transmission port for RabbitMQ communications |
-| `rabbitmq_pkg_state` | present | The state of the RabbitMQ package (should be set to `present` or `latest`) |
-| `rabbitmq_server` | `false` | Determines whether to include the deployment of RabbitMQ |
-| `rabbitmq_service_name` | rabbitmq-server | The name of the RabbitMQ service |
-| `rabbitmq_sensu_user_name` | sensu | Username for authentication with the RabbitMQ vhost |
-| `rabbitmq_sensu_password` | sensu | Password for authentication with the RabbitMQ vhost |
-| `rabbitmq_sensu_vhost` | `/sensu` | Name of the RabbitMQ Sensu vhost |
-| `rabbitmq_enable_ssl` | `true` | Determines whether or not to use `ssl_listener` for RabbitMQ |
+| `sensu_rabbitmq_config_path` | `/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
+| `sensu_rabbitmq_config_template` | `rabbitmq.config.j2` | The template to use for the RabbitMQ service configuration |
+|` sensu_rabbitmq_host` | `"{{ groups\['sensu_rabbitmq_servers']\[0] }}"` | The hostname/IP address of the RabbitMQ node |
+| `sensu_rabbitmq_port` | 5671 | The transmission port for RabbitMQ communications |
+| `sensu_rabbitmq_pkg_state` | present | The state of the RabbitMQ package (should be set to `present` or `latest`) |
+| `sensu_rabbitmq_server` | `false` | Determines whether to include the deployment of RabbitMQ |
+| `sensu_rabbitmq_service_name` | rabbitmq-server | The name of the RabbitMQ service |
+| `sensu_rabbitmq_sensu_user_name` | sensu | Username for authentication with the RabbitMQ vhost |
+| `sensu_rabbitmq_sensu_password` | sensu | Password for authentication with the RabbitMQ vhost |
+| `sensu_rabbitmq_sensu_vhost` | `/sensu` | Name of the RabbitMQ Sensu vhost |
+| `sensu_rabbitmq_enable_ssl` | `true` | Determines whether or not to use `ssl_listener` for RabbitMQ |
 
 ### [redis Server Properties](https://docs.sensu.io/sensu-core/latest/reference/redis/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `redis_host` | `"{{ groups['redis_servers'][0] }}"` | Hostname/IP address of the redis node |
-| `redis_server` | `false` | Determines whether to include the deployment of redis |
-| `redis_service_name` | redis |  The name of the redis service to enable |
-| `redis_pkg_repo` | _undefined_ |  The PPA to use for installing redis from (specific to Debian flavored systems) |
-| `redis_pkg_name` | redis |  The name of the redis package to install |
-| `redis_pkg_state` | present | The state of the redis package (should be set to `present` or `latest`) |
-| `redis_port` | 6379 | The transmission port for redis communications |
-| `redis_password` | `` | Password to use for redis authentication |
-| `redis_sentinels` | `[]` | List of Redis Sentinel servers to use, with each item having `host` and `port` keys. Disables Sentinel when empty/unset |
-| `redis_master_name` | `` | Name of the master (replica set) to use with Redis Sentinel |
+| `sensu_redis_host` | `"{{ groups['sensu_redis_servers'][0] }}"` | Hostname/IP address of the redis node |
+| `sensu_redis_server` | `false` | Determines whether to include the deployment of redis |
+| `sensu_redis_service_name` | redis |  The name of the redis service to enable |
+| `sensu_redis_pkg_repo` | _undefined_ |  The PPA to use for installing redis from (specific to Debian flavored systems) |
+| `sensu_redis_pkg_name` | redis |  The name of the redis package to install |
+| `sensu_redis_pkg_state` | present | The state of the redis package (should be set to `present` or `latest`) |
+| `sensu_redis_port` | 6379 | The transmission port for redis communications |
+| `sensu_redis_password` | `` | Password to use for redis authentication |
+| `sensu_redis_sentinels` | `[]` | List of Redis Sentinel servers to use, with each item having `host` and `port` keys. Disables Sentinel when empty/unset |
+| `sensu_redis_master_name` | `` | Name of the master (replica set) to use with Redis Sentinel |
 
 ### [Sensu Properties](https://docs.sensu.io/sensu-core/latest/overview/)
 | Name               | Default Value | Description                  |
@@ -96,8 +96,8 @@ _Note: The above options are intended to provide users with flexibility. This al
 ### [redis Server Properties](https://docs.sensu.io/sensu-core/latest/reference/redis/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `redis_pkg_name` | redis-server |  The name of the redis package to install |
-| `redis_service_name` | redis-server | The name of the redis service |
+| `sensu_redis_pkg_name` | redis-server |  The name of the redis package to install |
+| `sensu_redis_service_name` | redis-server | The name of the redis service |
 
 ### [Sensu Properties](https://docs.sensu.io/sensu-core/latest/overview/)
 | Name               | Default Value | Description                  |
@@ -109,8 +109,8 @@ _Note: The above options are intended to provide users with flexibility. This al
 ### [redis Server Properties](https://docs.sensu.io/sensu-core/latest/reference/redis/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `redis_pkg_name` | redis-server | The name of the redis service |
-| `redis_service_name` | redis-server | The name of the redis service |
+| `sensu_redis_pkg_name` | redis-server | The name of the redis service |
+| `sensu_redis_service_name` | redis-server | The name of the redis service |
 
 ### [Sensu Properties](https://docs.sensu.io/sensu-core/latest/overview/)
 | Name               | Default Value | Description                  |
@@ -131,8 +131,8 @@ _Note: The above options are intended to provide users with flexibility. This al
 ### [RabbitMQ Server Properties](https://docs.sensu.io/sensu-core/latest/reference/rabbitmq/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `rabbitmq_config_path` | `/opt/local/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
-| `rabbitmq_service_name` | rabbitmq | The name of the RabbitMQ service |
+| `sensu_rabbitmq_config_path` | `/opt/local/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
+| `sensu_rabbitmq_service_name` | rabbitmq | The name of the RabbitMQ service |
 
 ### [Sensu Properties](https://docs.sensu.io/sensu-core/latest/overview/)
 | Name               | Default Value | Description                  |
@@ -150,8 +150,8 @@ _Note: The above options are intended to provide users with flexibility. This al
 ### [RabbitMQ Server Properties](https://docs.sensu.io/sensu-core/latest/reference/rabbitmq/)
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-| `rabbitmq_service_name` | `rabbitmq` | The name of the RabbitMQ service |
-| `rabbitmq_config_path` | `/usr/local/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
+| `sensu_rabbitmq_service_name` | `rabbitmq` | The name of the RabbitMQ service |
+| `sensu_rabbitmq_config_path` | `/usr/local/etc/rabbitmq` | Path to the RabbitMQ configuration directory |
 
 ### Internal properties
 ## Internal settings

+ 10 - 11
docs/single_master.md

@@ -1,9 +1,9 @@
 # Deploy the stack to a single node
-Hopefully after a quick read of the example infrastructure document, it becomes clear that this could all be applied to one node in your infrastructure.  
+Hopefully after a quick read of the example infrastructure document, it becomes clear that this could all be applied to one node in your infrastructure.
 If you're just wanting to test this out, or if you don't want to distribute your services for some other reason; you can simply deploy the components to a single node.
 
 This is achieved in the exact same way, setting each of the variables listed to `true`, but for one node only.
-There are, however, a couple tweaks that can be made to keep your inventory a little cleaner. That is to say; if you didn't want to define `rabbitmq_servers` or `redis_servers` to simply include one node.
+There are, however, a couple tweaks that can be made to keep your inventory a little cleaner. That is to say; if you didn't want to define `sensu_rabbitmq_servers` or `sensu_redis_servers` to simply include one node.
 
 This can be done with the following snippets.
 
@@ -12,29 +12,28 @@ This can be done with the following snippets.
 ``` yaml
 sensu_master: true
 sensu_include_dashboard: true
-rabbitmq_server: true
-redis_server: true
+sensu_rabbitmq_server: true
+sensu_redis_server: true
 ```
 This would set the node `master.cmacr.ae` to act as the Sensu, RabbitMQ, and redis server for all Sensu communications across your infrastructure.
 
 ## Statically setting the communication endpoints
 In `defaults/main.yml` the following keys have the following values:
 ``` yaml
-rabbitmq_host: "{{ groups['rabbitmq_servers'][0] }}"
-redis_host: "{{ groups['redis_servers'][0] }}"
+sensu_rabbitmq_host: "{{ groups['sensu_rabbitmq_servers'][0] }}"
+sensu_redis_host: "{{ groups['sensu_redis_servers'][0] }}"
 sensu_api_host: "{{ groups['sensu_masters'][0] }}"
 ```
 
-These are very important values, they determine the points of communication for each component of Sensu.  
-If you're just deploying the stack to a single node and you've decided you'd like to leave any of the `rabbitmq_servers`/`redis_servers`/`sensu_masters` groups out of your inventory, you'll need to statically set the communication endpoints.
+These are very important values, they determine the points of communication for each component of Sensu.
+If you're just deploying the stack to a single node and you've decided you'd like to leave any of the `sensu_rabbitmq_servers`/`sensu_redis_servers`/`sensu_masters` groups out of your inventory, you'll need to statically set the communication endpoints.
 
 Where you set this is, again, up to you - Ansible really is quite versatile!
 If you're deploying the Sensu client to all your nodes - as you should be ;) - it's only logical to set these values globally.
 You can do so by setting them in `group_vars/all.yml`:
 ``` yaml
-rabbitmq_host: master.cmacr.ae
-redis_host: master.cmacr.ae
+sensu_rabbitmq_host: master.cmacr.ae
+sensu_redis_host: master.cmacr.ae
 sensu_api_host: master.cmacr.ae
 ```
 This will tell your entire environment that if they're looking to communicate with RabbitMQ, redis, or the Sensu API, they can talk to `master.cmacr.ae`. Of course, if you're just distributing Sensu to just the `zones` group or `some_other_group`, the same could be set in `group_vars/zones.yml`/`group_vars/some_other_group.yml`.
-

+ 2 - 2
handlers/main.yml

@@ -2,12 +2,12 @@
 
 - name: restart rabbitmq service
   service:
-    name: "{{ rabbitmq_service_name }}"
+    name: "{{ sensu_rabbitmq_service_name }}"
     state: restarted
 
 - name: restart redis service
   service:
-    name: "{{ redis_service_name }}"
+    name: "{{ sensu_redis_service_name }}"
     pattern: /usr/bin/redis-server
     state: restarted
 

+ 4 - 4
molecule/amazonlinux/molecule.yml

@@ -44,10 +44,10 @@ provisioner:
       all:
         sensu_master: true
         sensu_include_dashboard: true
-        rabbitmq_server: true
-        redis_server: true
-        rabbitmq_host: "{{ ansible_hostname }}"
-        redis_host: "{{ ansible_hostname }}"
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
         sensu_api_host: "{{ ansible_hostname }}"
         ansible_default_ipv4:
           address: 127.0.0.1

+ 4 - 4
molecule/centos/molecule.yml

@@ -44,10 +44,10 @@ provisioner:
       all:
         sensu_master: true
         sensu_include_dashboard: true
-        rabbitmq_server: true
-        redis_server: true
-        rabbitmq_host: "{{ ansible_hostname }}"
-        redis_host: "{{ ansible_hostname }}"
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
         sensu_api_host: "{{ ansible_hostname }}"
         ansible_default_ipv4:
           address: 127.0.0.1

+ 4 - 4
molecule/debian/molecule.yml

@@ -45,10 +45,10 @@ provisioner:
       all:
         sensu_master: true
         sensu_include_dashboard: true
-        rabbitmq_server: true
-        redis_server: true
-        rabbitmq_host: "{{ ansible_hostname }}"
-        redis_host: "{{ ansible_hostname }}"
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
         sensu_api_host: "{{ ansible_hostname }}"
         ansible_default_ipv4:
           address: 127.0.0.1

+ 4 - 4
molecule/fedora/molecule.yml

@@ -53,10 +53,10 @@ provisioner:
       all:
         sensu_master: true
         sensu_include_dashboard: true
-        rabbitmq_server: true
-        redis_server: true
-        rabbitmq_host: "{{ ansible_hostname }}"
-        redis_host: "{{ ansible_hostname }}"
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
         sensu_api_host: "{{ ansible_hostname }}"
         ansible_default_ipv4:
           address: 127.0.0.1

+ 4 - 4
molecule/ubuntu/molecule.yml

@@ -51,10 +51,10 @@ provisioner:
       all:
         sensu_master: true
         sensu_include_dashboard: true
-        rabbitmq_server: true
-        redis_server: true
-        rabbitmq_host: "{{ ansible_hostname }}"
-        redis_host: "{{ ansible_hostname }}"
+        sensu_rabbitmq_server: true
+        sensu_redis_server: true
+        sensu_rabbitmq_host: "{{ ansible_hostname }}"
+        sensu_redis_host: "{{ ansible_hostname }}"
         sensu_api_host: "{{ ansible_hostname }}"
         ansible_default_ipv4:
           address: 127.0.0.1

+ 2 - 2
tasks/Amazon/redis.yml

@@ -17,8 +17,8 @@
 - name: Ensure redis is installed
   tags: redis
   yum:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
     enablerepo: epel
 
 - name: Ensure redis binds to accessible IP

+ 2 - 2
tasks/CentOS/redis.yml

@@ -17,8 +17,8 @@
 - name: Ensure redis is installed
   tags: redis
   yum:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
     enablerepo: "{{ centos_repository }}"
 
 - name: Ensure redis binds to accessible IP

+ 1 - 1
tasks/Debian/rabbit.yml

@@ -48,6 +48,6 @@
   tags: rabbitmq
   apt:
     name: rabbitmq-server
-    state: "{{ rabbitmq_pkg_state }}"
+    state: "{{ sensu_rabbitmq_pkg_state }}"
     cache_valid_time: 600
     update_cache: true

+ 2 - 2
tasks/Debian/redis.yml

@@ -10,8 +10,8 @@
 - name: Ensure redis is installed
   tags: redis
   apt:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
     update_cache: true
 
 - name: Ensure redis binds to accessible IP

+ 2 - 2
tasks/Fedora/redis.yml

@@ -16,8 +16,8 @@
 - name: Ensure redis is installed
   tags: redis
   dnf:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
 
 - name: Ensure redis binds to accessible IP
   tags: redis

+ 1 - 1
tasks/FreeBSD/rabbit.yml

@@ -11,4 +11,4 @@
   tags: rabbitmq
   pkgng:
     name: rabbitmq
-    state: "{{ rabbitmq_pkg_state }}"
+    state: "{{ sensu_rabbitmq_pkg_state }}"

+ 2 - 2
tasks/FreeBSD/redis.yml

@@ -10,8 +10,8 @@
 - name: Ensure redis is installed
   tags: redis
   pkgng:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
 
 - name: Ensure redis binds to accessible IP
   tags: redis

+ 1 - 1
tasks/OpenBSD/rabbit.yml

@@ -11,4 +11,4 @@
   tags: rabbitmq
   pkgng:
     name: rabbitmq
-    state: "{{ rabbitmq_pkg_state }}"
+    state: "{{ sensu_rabbitmq_pkg_state }}"

+ 2 - 2
tasks/OpenBSD/redis.yml

@@ -10,8 +10,8 @@
 - name: Ensure redis is installed
   tags: redis
   pkgng:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
 
 - name: Ensure redis binds to accessible IP
   tags: redis

+ 1 - 1
tasks/SmartOS/redis.yml

@@ -9,4 +9,4 @@
 
 - name: Ensure redis is installed
   tags: redis
-  pkgin: name=redis state={{ redis_pkg_state }}
+  pkgin: name=redis state={{ sensu_redis_pkg_state }}

+ 1 - 1
tasks/Ubuntu/rabbit.yml

@@ -48,6 +48,6 @@
   tags: rabbitmq
   apt:
     name: rabbitmq-server
-    state: "{{ rabbitmq_pkg_state }}"
+    state: "{{ sensu_rabbitmq_pkg_state }}"
     cache_valid_time: 600
     update_cache: true

+ 2 - 2
tasks/Ubuntu/redis.yml

@@ -8,8 +8,8 @@
 
 - name: Ensure redis is installed
   apt:
-    name: "{{ redis_pkg_name }}"
-    state: "{{ redis_pkg_state }}"
+    name: "{{ sensu_redis_pkg_name }}"
+    state: "{{ sensu_redis_pkg_state }}"
     update_cache: true
   register: sensu_ubuntu_redis_install
 

+ 2 - 2
tasks/main.yml

@@ -12,7 +12,7 @@
 
 - import_tasks: "redis.yml"
   tags: redis
-  when: redis_server
+  when: sensu_redis_server
         and sensu_deploy_redis_server
 
 - import_tasks: "ssl.yml"
@@ -20,7 +20,7 @@
 
 - import_tasks: "rabbit.yml"
   tags: rabbitmq
-  when: rabbitmq_server
+  when: sensu_rabbitmq_server
         and sensu_deploy_rabbitmq_server
 
 - import_tasks: "common.yml"

+ 13 - 13
tasks/rabbit.yml

@@ -12,14 +12,14 @@
 - name: Ensure RabbitMQ SSL directory exists
   tags: rabbitmq
   file:
-    dest: "{{ rabbitmq_config_path }}/ssl"
+    dest: "{{ sensu_rabbitmq_config_path }}/ssl"
     state: directory
 
 - name: Ensure RabbitMQ SSL certs/keys are in place
   tags: rabbitmq
   copy:
     src: "{{ item.src }}"
-    dest: "{{ rabbitmq_config_path }}/ssl/{{ item.dest }}"
+    dest: "{{ sensu_rabbitmq_config_path }}/ssl/{{ item.dest }}"
     remote_src: "{{ sensu_ssl_deploy_remote_src }}"
   loop:
     - { src: "{{ sensu_ssl_server_cacert }}", dest: cacert.pem }
@@ -35,8 +35,8 @@
 - name: Deploy RabbitMQ config
   tags: rabbitmq
   template:
-    dest: "{{ rabbitmq_config_path }}/rabbitmq.config"
-    src: "{{ rabbitmq_config_template }}"
+    dest: "{{ sensu_rabbitmq_config_path }}/rabbitmq.config"
+    src: "{{ sensu_rabbitmq_config_template }}"
     owner: root
     group: "{{ __root_group }}"
     mode: 0644
@@ -45,28 +45,28 @@
 - name: Ensure RabbitMQ is running
   tags: rabbitmq
   service:
-    name: "{{ rabbitmq_service_name }}"
+    name: "{{ sensu_rabbitmq_service_name }}"
     state: started
     enabled: true
-  register: rabbitmq_state
+  register: sensu_rabbitmq_state
 
 - name: Wait for RabbitMQ to be up and running before asking to create a vhost
   tags: rabbitmq
   pause:
     seconds: 3
-  when: rabbitmq_state is changed
+  when: sensu_rabbitmq_state is changed
 
 - block:
     - name: Ensure Sensu RabbitMQ vhost exists
-      rabbitmq_vhost:
-        name: "{{ rabbitmq_sensu_vhost }}"
+      sensu_rabbitmq_vhost:
+        name: "{{ sensu_rabbitmq_sensu_vhost }}"
         state: present
 
     - name: Ensure Sensu RabbitMQ user has access to the Sensu vhost
-      rabbitmq_user:
-        user: "{{ rabbitmq_sensu_user_name }}"
-        password: "{{ rabbitmq_sensu_password }}"
-        vhost: "{{ rabbitmq_sensu_vhost }}"
+      sensu_rabbitmq_user:
+        user: "{{ sensu_rabbitmq_sensu_user_name }}"
+        password: "{{ sensu_rabbitmq_sensu_password }}"
+        vhost: "{{ sensu_rabbitmq_sensu_vhost }}"
         configure_priv: .*
         read_priv: .*
         write_priv: .*

+ 1 - 1
tasks/redis.yml

@@ -8,7 +8,7 @@
 - name: Ensure redis is running
   tags: redis
   service:
-    name: "{{ redis_service_name }}"
+    name: "{{ sensu_redis_service_name }}"
     pattern: /usr/bin/redis-server
     state: started
     enabled: true

+ 6 - 6
templates/rabbitmq.config.j2

@@ -1,16 +1,16 @@
 [
     {rabbit, [
-    {% if rabbitmq_enable_ssl %}
-    {ssl_listeners, [{{ rabbitmq_port }}]},
-    {ssl_options, [{cacertfile,"{{ rabbitmq_config_path }}/ssl/cacert.pem"},
-                   {certfile,"{{ rabbitmq_config_path }}/ssl/cert.pem"},
-                   {keyfile,"{{ rabbitmq_config_path }}/ssl/key.pem"},
+    {% if sensu_rabbitmq_enable_ssl %}
+    {ssl_listeners, [{{ sensu_rabbitmq_port }}]},
+    {ssl_options, [{cacertfile,"{{ sensu_rabbitmq_config_path }}/ssl/cacert.pem"},
+                   {certfile,"{{ sensu_rabbitmq_config_path }}/ssl/cert.pem"},
+                   {keyfile,"{{ sensu_rabbitmq_config_path }}/ssl/key.pem"},
                    {verify,verify_peer},
                    {versions, ['tlsv1.2']},
                    {ciphers,  [{rsa,aes_256_cbc,sha256}]},
                    {fail_if_no_peer_cert,true}]}
     {% else %}
-    {tcp_listeners, [{{ rabbitmq_port }}]}
+    {tcp_listeners, [{{ sensu_rabbitmq_port }}]}
     {% endif %}
   ]}
 ].

+ 1 - 1
templates/sensu-rabbitmq.json.j2

@@ -1,6 +1,6 @@
 {
   "rabbitmq": {
-    {% if rabbitmq_enable_ssl %}
+    {% if sensu_rabbitmq_enable_ssl %}
     "ssl": {
       "cert_chain_file": "{{ sensu_config_path }}/ssl/cert.pem",
       "private_key_file": "{{ sensu_config_path }}/ssl/key.pem"

+ 7 - 7
templates/sensu-redis.json.j2

@@ -1,14 +1,14 @@
 {
   "redis": {
-{% if redis_password %}
-    "password": "{{ redis_password }}",
+{% if sensu_redis_password %}
+    "password": "{{ sensu_redis_password }}",
 {% endif %}
-{% if redis_sentinels %}
-    "sentinels": {{ redis_sentinels | to_nice_json }},
-    "master": "{{ redis_master_name }}"
+{% if sensu_redis_sentinels %}
+    "sentinels": {{ sensu_redis_sentinels | to_nice_json }},
+    "master": "{{ sensu_redis_master_name }}"
 {% else %}
-    "host": "{{ redis_host }}",
-    "port": {{ redis_port }}
+    "host": "{{ sensu_redis_host }}",
+    "port": {{ sensu_redis_port }}
 {% endif %}
   }
 }

+ 6 - 6
vars/CentOS.yml

@@ -5,9 +5,9 @@
 # Set this to false to disable the EPEL repo installation
 enable_epel_repo: true
 
-sensu_rabbitmq_repo_version: v3.7.x
-sensu_rabbitmq_erlang_repo_version: 20
-sensu_rabbitmq_signing_key: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
-sensu_rabbitmq_baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/{{ sensu_rabbitmq_repo_version }}/el/{{ ansible_distribution_major_version }}"
-sensu_rabbitmq_erlang_signing_key: "{{ sensu_rabbitmq_signing_key }}"
-sensu_rabbitmq_erlang_baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/{{ sensu_rabbitmq_erlang_repo_version }}/el/{{ ansible_distribution_major_version }}"
+sensu_rabbitmq_bitmq_repo_version: v3.7.x
+sensu_rabbitmq_bitmq_erlang_repo_version: 20
+sensu_rabbitmq_bitmq_signing_key: https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
+sensu_rabbitmq_bitmq_baseurl: "https://dl.bintray.com/rabbitmq/rpm/rabbitmq-server/{{ sensu_rabbitmq_su_rabbitmq_repo_version }}/el/{{ ansible_distribution_major_version }}"
+sensu_rabbitmq_bitmq_erlang_signing_key: "{{ sensu_rabbitmq_su_rabbitmq_signing_key }}"
+sensu_rabbitmq_bitmq_erlang_baseurl: "https://dl.bintray.com/rabbitmq/rpm/erlang/{{ sensu_rabbitmq_su_rabbitmq_erlang_repo_version }}/el/{{ ansible_distribution_major_version }}"

+ 2 - 2
vars/Debian.yml

@@ -3,8 +3,8 @@
 # Defaults are defined in defaults/main.yml
 
 # redis server properties
-redis_pkg_name: redis-server
-redis_service_name: redis-server
+sensu_redis_pkg_name: redis-server
+sensu_redis_service_name: redis-server
 
 sensu_erlang_pin_package: 'esl-erlang erlang*'
 sensu_erlang_pin_version: '1:20.3*'

+ 2 - 2
vars/FreeBSD.yml

@@ -6,8 +6,8 @@
 sensu_config_path: /usr/local/etc/sensu
 
 # RabbitMQ options
-rabbitmq_config_path: /usr/local/etc/rabbitmq
-rabbitmq_service_name: rabbitmq
+sensu_rabbitmq_config_path: /usr/local/etc/rabbitmq
+sensu_rabbitmq_service_name: rabbitmq
 
 # Internal settings
 __bash_path: /usr/local/bin/bash

+ 2 - 2
vars/OpenBSD.yml

@@ -8,8 +8,8 @@ sensu_gem_version: 0.29.0
 sensu_client_service_name: sensuclient
 
 # RabbitMQ options
-rabbitmq_config_path: /etc/rabbitmq
-rabbitmq_service_name: rabbitmq
+sensu_rabbitmq_config_path: /etc/rabbitmq
+sensu_rabbitmq_service_name: rabbitmq
 
 # Internal settings
 __bash_path: /usr/local/bin/bash

+ 2 - 2
vars/SmartOS.yml

@@ -3,8 +3,8 @@
 # Defaults are defined in defaults/main.yml
 
 # RabbitMQ server properties
-rabbitmq_service_name: rabbitmq
-rabbitmq_config_path: /opt/local/etc/rabbitmq
+sensu_rabbitmq_service_name: rabbitmq
+sensu_rabbitmq_config_path: /opt/local/etc/rabbitmq
 
 # Sensu/Uchiwa user/group/service properties
 sensu_config_path: /opt/local/etc/sensu

+ 2 - 2
vars/Ubuntu.yml

@@ -3,8 +3,8 @@
 # Defaults are defined in defaults/main.yml
 
 # redis server properties
-redis_pkg_name: redis-server
-redis_service_name: redis-server
+sensu_redis_pkg_name: redis-server
+sensu_redis_service_name: redis-server
 
 
 sensu_erlang_pin_package: 'esl-erlang erlang*'