From 0d80939ea114d9e5ec2a82b8bfd1e4bf7d38fe17 Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Sun, 17 Feb 2019 20:43:24 -0500 Subject: [PATCH 1/5] 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. --- defaults/main.yml | 42 +++++++++++----------- docs/dynamic_checks.md | 20 +++++------ docs/dynamic_data.md | 2 +- docs/example_infra.md | 18 +++++----- docs/integration.md | 18 +++++----- docs/role_variables.md | 58 +++++++++++++++---------------- docs/single_master.md | 21 ++++++----- handlers/main.yml | 4 +-- molecule/amazonlinux/molecule.yml | 8 ++--- molecule/centos/molecule.yml | 8 ++--- molecule/debian/molecule.yml | 8 ++--- molecule/fedora/molecule.yml | 8 ++--- molecule/ubuntu/molecule.yml | 8 ++--- tasks/Amazon/redis.yml | 4 +-- tasks/CentOS/redis.yml | 4 +-- tasks/Debian/rabbit.yml | 2 +- tasks/Debian/redis.yml | 4 +-- tasks/Fedora/redis.yml | 4 +-- tasks/FreeBSD/rabbit.yml | 2 +- tasks/FreeBSD/redis.yml | 4 +-- tasks/OpenBSD/rabbit.yml | 2 +- tasks/OpenBSD/redis.yml | 4 +-- tasks/SmartOS/redis.yml | 2 +- tasks/Ubuntu/rabbit.yml | 2 +- tasks/Ubuntu/redis.yml | 4 +-- tasks/main.yml | 4 +-- tasks/rabbit.yml | 26 +++++++------- tasks/redis.yml | 2 +- templates/rabbitmq.config.j2 | 12 +++---- templates/sensu-rabbitmq.json.j2 | 2 +- templates/sensu-redis.json.j2 | 14 ++++---- vars/CentOS.yml | 12 +++---- vars/Debian.yml | 4 +-- vars/FreeBSD.yml | 4 +-- vars/OpenBSD.yml | 4 +-- vars/SmartOS.yml | 4 +-- vars/Ubuntu.yml | 4 +-- 37 files changed, 176 insertions(+), 177 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3df334ba..5db2154b 100644 --- a/defaults/main.yml +++ b/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 diff --git a/docs/dynamic_checks.md b/docs/dynamic_checks.md index 9d881b1f..3787d6d7 100644 --- a/docs/dynamic_checks.md +++ b/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! diff --git a/docs/dynamic_data.md b/docs/dynamic_data.md index 46b8d12b..a16cee85 100644 --- a/docs/dynamic_data.md +++ b/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 }}" diff --git a/docs/example_infra.md b/docs/example_infra.md index 63f14d34..8a203e87 100644 --- a/docs/example_infra.md +++ b/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`. diff --git a/docs/integration.md b/docs/integration.md index dd9ee202..c6f662f1 100644 --- a/docs/integration.md +++ b/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 diff --git a/docs/role_variables.md b/docs/role_variables.md index e653a6dc..f50d4d0e 100644 --- a/docs/role_variables.md +++ b/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 diff --git a/docs/single_master.md b/docs/single_master.md index 8980136a..b258cc98 100644 --- a/docs/single_master.md +++ b/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`. - diff --git a/handlers/main.yml b/handlers/main.yml index fae1bbbd..fda3da41 100644 --- a/handlers/main.yml +++ b/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 diff --git a/molecule/amazonlinux/molecule.yml b/molecule/amazonlinux/molecule.yml index 07cafcb4..23e22725 100644 --- a/molecule/amazonlinux/molecule.yml +++ b/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 diff --git a/molecule/centos/molecule.yml b/molecule/centos/molecule.yml index 3a547e4c..0d12a760 100644 --- a/molecule/centos/molecule.yml +++ b/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 diff --git a/molecule/debian/molecule.yml b/molecule/debian/molecule.yml index b4503393..b4616745 100644 --- a/molecule/debian/molecule.yml +++ b/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 diff --git a/molecule/fedora/molecule.yml b/molecule/fedora/molecule.yml index 2e39daa3..b42b8c94 100644 --- a/molecule/fedora/molecule.yml +++ b/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 diff --git a/molecule/ubuntu/molecule.yml b/molecule/ubuntu/molecule.yml index 9c909c45..e7a170b6 100644 --- a/molecule/ubuntu/molecule.yml +++ b/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 diff --git a/tasks/Amazon/redis.yml b/tasks/Amazon/redis.yml index 1a3edcdf..8fdd9dcd 100644 --- a/tasks/Amazon/redis.yml +++ b/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 diff --git a/tasks/CentOS/redis.yml b/tasks/CentOS/redis.yml index 3c3102c5..8a5bf173 100644 --- a/tasks/CentOS/redis.yml +++ b/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 diff --git a/tasks/Debian/rabbit.yml b/tasks/Debian/rabbit.yml index 29fe502d..841c6581 100644 --- a/tasks/Debian/rabbit.yml +++ b/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 diff --git a/tasks/Debian/redis.yml b/tasks/Debian/redis.yml index 5de58abc..3592f602 100644 --- a/tasks/Debian/redis.yml +++ b/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 diff --git a/tasks/Fedora/redis.yml b/tasks/Fedora/redis.yml index ca006d05..952d0ca2 100644 --- a/tasks/Fedora/redis.yml +++ b/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 diff --git a/tasks/FreeBSD/rabbit.yml b/tasks/FreeBSD/rabbit.yml index cfb1642a..44f854d7 100644 --- a/tasks/FreeBSD/rabbit.yml +++ b/tasks/FreeBSD/rabbit.yml @@ -11,4 +11,4 @@ tags: rabbitmq pkgng: name: rabbitmq - state: "{{ rabbitmq_pkg_state }}" + state: "{{ sensu_rabbitmq_pkg_state }}" diff --git a/tasks/FreeBSD/redis.yml b/tasks/FreeBSD/redis.yml index d1cf6f72..9a821d3c 100644 --- a/tasks/FreeBSD/redis.yml +++ b/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 diff --git a/tasks/OpenBSD/rabbit.yml b/tasks/OpenBSD/rabbit.yml index fcffc35c..1437c3bd 100644 --- a/tasks/OpenBSD/rabbit.yml +++ b/tasks/OpenBSD/rabbit.yml @@ -11,4 +11,4 @@ tags: rabbitmq pkgng: name: rabbitmq - state: "{{ rabbitmq_pkg_state }}" + state: "{{ sensu_rabbitmq_pkg_state }}" diff --git a/tasks/OpenBSD/redis.yml b/tasks/OpenBSD/redis.yml index a4698697..45f494cf 100644 --- a/tasks/OpenBSD/redis.yml +++ b/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 diff --git a/tasks/SmartOS/redis.yml b/tasks/SmartOS/redis.yml index 17dedd06..7b15fced 100644 --- a/tasks/SmartOS/redis.yml +++ b/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 }} diff --git a/tasks/Ubuntu/rabbit.yml b/tasks/Ubuntu/rabbit.yml index 163fa75d..8e2b5a5f 100644 --- a/tasks/Ubuntu/rabbit.yml +++ b/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 diff --git a/tasks/Ubuntu/redis.yml b/tasks/Ubuntu/redis.yml index 108bb139..9dc82ec6 100644 --- a/tasks/Ubuntu/redis.yml +++ b/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 diff --git a/tasks/main.yml b/tasks/main.yml index 545e069e..3a4f805d 100644 --- a/tasks/main.yml +++ b/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" diff --git a/tasks/rabbit.yml b/tasks/rabbit.yml index ad140619..7117fac1 100644 --- a/tasks/rabbit.yml +++ b/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: .* diff --git a/tasks/redis.yml b/tasks/redis.yml index dcac31a8..44554b0d 100644 --- a/tasks/redis.yml +++ b/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 diff --git a/templates/rabbitmq.config.j2 b/templates/rabbitmq.config.j2 index 3dc95741..13885649 100644 --- a/templates/rabbitmq.config.j2 +++ b/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 %} ]} ]. diff --git a/templates/sensu-rabbitmq.json.j2 b/templates/sensu-rabbitmq.json.j2 index bc905c26..ef5b08c5 100644 --- a/templates/sensu-rabbitmq.json.j2 +++ b/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" diff --git a/templates/sensu-redis.json.j2 b/templates/sensu-redis.json.j2 index 06cf91ba..6b98b899 100644 --- a/templates/sensu-redis.json.j2 +++ b/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 %} } } diff --git a/vars/CentOS.yml b/vars/CentOS.yml index 15752c1d..838c31aa 100644 --- a/vars/CentOS.yml +++ b/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 }}" diff --git a/vars/Debian.yml b/vars/Debian.yml index cd418231..e6cc3a51 100644 --- a/vars/Debian.yml +++ b/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*' diff --git a/vars/FreeBSD.yml b/vars/FreeBSD.yml index 9d504544..1db32851 100644 --- a/vars/FreeBSD.yml +++ b/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 diff --git a/vars/OpenBSD.yml b/vars/OpenBSD.yml index 473a4158..64f445e9 100644 --- a/vars/OpenBSD.yml +++ b/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 diff --git a/vars/SmartOS.yml b/vars/SmartOS.yml index 13a5cede..a2bf5fcf 100644 --- a/vars/SmartOS.yml +++ b/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 diff --git a/vars/Ubuntu.yml b/vars/Ubuntu.yml index 80aa1869..48d404ee 100644 --- a/vars/Ubuntu.yml +++ b/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*' From ebb01117909d8cadbcfa53b8912a2e26ebb2de21 Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Sun, 17 Feb 2019 20:51:33 -0500 Subject: [PATCH 2/5] update rabbitmq tempate --- templates/sensu-rabbitmq.json.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/templates/sensu-rabbitmq.json.j2 b/templates/sensu-rabbitmq.json.j2 index ef5b08c5..9f25cd25 100644 --- a/templates/sensu-rabbitmq.json.j2 +++ b/templates/sensu-rabbitmq.json.j2 @@ -6,10 +6,10 @@ "private_key_file": "{{ sensu_config_path }}/ssl/key.pem" }, {% endif %} - "host": "{{ rabbitmq_host }}", - "port": {{ rabbitmq_port }}, - "vhost": "{{ rabbitmq_sensu_vhost }}", - "user": "{{ rabbitmq_sensu_user_name }}", - "password": "{{ rabbitmq_sensu_password }}" + "host": "{{ sensu_rabbitmq_host }}", + "port": {{ sensu_rabbitmq_port }}, + "vhost": "{{ sensu_rabbitmq_sensu_vhost }}", + "user": "{{ sensu_rabbitmq_sensu_user_name }}", + "password": "{{ sensu_rabbitmq_sensu_password }}" } } From b4d6476ae57c7a20877950e368f54323554b386b Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Sun, 17 Feb 2019 21:00:31 -0500 Subject: [PATCH 3/5] fix redundancies in sensu_rabbitmq_sensu --- defaults/main.yml | 6 +++--- docs/integration.md | 6 +++--- docs/role_variables.md | 6 +++--- tasks/rabbit.yml | 12 ++++++------ templates/sensu-rabbitmq.json.j2 | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 5db2154b..3a66b6be 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -38,9 +38,9 @@ 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 +sensu_rabbitmq_user_name: sensu +sensu_rabbitmq_password: sensu +sensu_rabbitmq_vhost: /sensu # redis server properties sensu_redis_host: "{{ groups['sensu_redis_servers'][0] }}" diff --git a/docs/integration.md b/docs/integration.md index c6f662f1..15cbfadb 100644 --- a/docs/integration.md +++ b/docs/integration.md @@ -9,9 +9,9 @@ If you'd like to use a different role/management method for RabbitMQ, the follow sensu_deploy_rabbitmq_server: false 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_user_name: < the username for interacting with RabbitMQ > +sensu_rabbitmq_password: < the password for interacting with RabbitMQ > +sensu_rabbitmq_vhost: < the RabbitMQ vhost to use, defaults to '/sensu' > sensu_rabbitmq_config_path: < the path to the RabbitMQ configuration > ``` diff --git a/docs/role_variables.md b/docs/role_variables.md index f50d4d0e..bd1faf86 100644 --- a/docs/role_variables.md +++ b/docs/role_variables.md @@ -19,9 +19,9 @@ _Note: The above options are intended to provide users with flexibility. This al | `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_user_name` | sensu | Username for authentication with the RabbitMQ vhost | +| `sensu_rabbitmq_password` | sensu | Password for authentication with the RabbitMQ vhost | +| `sensu_rabbitmq_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/) diff --git a/tasks/rabbit.yml b/tasks/rabbit.yml index 7117fac1..aebe60a1 100644 --- a/tasks/rabbit.yml +++ b/tasks/rabbit.yml @@ -58,15 +58,15 @@ - block: - name: Ensure Sensu RabbitMQ vhost exists - sensu_rabbitmq_vhost: - name: "{{ sensu_rabbitmq_sensu_vhost }}" + rabbitmq_vhost: + name: "{{ sensu_rabbitmq_vhost }}" state: present - name: Ensure Sensu RabbitMQ user has access to the Sensu vhost - sensu_rabbitmq_user: - user: "{{ sensu_rabbitmq_sensu_user_name }}" - password: "{{ sensu_rabbitmq_sensu_password }}" - vhost: "{{ sensu_rabbitmq_sensu_vhost }}" + rabbitmq_user: + user: "{{ sensu_rabbitmq_user_name }}" + password: "{{ sensu_rabbitmq_password }}" + vhost: "{{ sensu_rabbitmq_vhost }}" configure_priv: .* read_priv: .* write_priv: .* diff --git a/templates/sensu-rabbitmq.json.j2 b/templates/sensu-rabbitmq.json.j2 index 9f25cd25..00634397 100644 --- a/templates/sensu-rabbitmq.json.j2 +++ b/templates/sensu-rabbitmq.json.j2 @@ -8,8 +8,8 @@ {% endif %} "host": "{{ sensu_rabbitmq_host }}", "port": {{ sensu_rabbitmq_port }}, - "vhost": "{{ sensu_rabbitmq_sensu_vhost }}", - "user": "{{ sensu_rabbitmq_sensu_user_name }}", - "password": "{{ sensu_rabbitmq_sensu_password }}" + "vhost": "{{ sensu_rabbitmq_vhost }}", + "user": "{{ sensu_rabbitmq_user_name }}", + "password": "{{ sensu_rabbitmq_password }}" } } From 7484a348ae897afbf590b62aab5192c4fe729580 Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Sun, 17 Feb 2019 21:19:22 -0500 Subject: [PATCH 4/5] fix(variables) CentOS variable issues with last edit. --- vars/CentOS.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vars/CentOS.yml b/vars/CentOS.yml index 838c31aa..15752c1d 100644 --- a/vars/CentOS.yml +++ b/vars/CentOS.yml @@ -5,9 +5,9 @@ # Set this to false to disable the EPEL repo installation enable_epel_repo: true -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 }}" +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 }}" From 78fd73bd48f3e295f1cce8fffb399084a8ea00a2 Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Mon, 18 Feb 2019 19:53:39 -0500 Subject: [PATCH 5/5] chore(namespace) Update uchiwa_ namespace to sensu_uchiwa_ --- CHANGELOG.md | 2 +- defaults/main.yml | 22 +++++++++---------- docs/role_variables.md | 20 ++++++++--------- docs/sensitive_info.md | 6 ++--- handlers/main.yml | 2 +- tasks/CentOS/redis.yml | 2 +- tasks/FreeBSD/dashboard.yml | 12 +++++----- tasks/OpenBSD/dashboard.yml | 12 +++++----- tasks/SmartOS/dashboard.yml | 12 +++++----- .../sensu_enterprise_dashboard_config.json.j2 | 10 ++++----- templates/uchiwa.sh.j2 | 2 +- templates/uchiwa.smartos_smf_manifest.xml.j2 | 2 +- templates/uchiwa_config.json.j2 | 18 +++++++-------- templates/uchiwa_freebsd.j2 | 4 ++-- 14 files changed, 63 insertions(+), 63 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0467515f..3ce11d5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,7 +94,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). - `defaults/main.yaml`,`tasks/plugins.yml`: Fix Python 3.X compatability issue when checking the contents of sensu_remote_plugins. (@danragnar) ### Added -- `templates/sensu-api-json.j2`, `templates/uchiwa_config.json.j2`: Check for explicitly defining uchiwa_users and sensu_api_user_name as empty to disable authentication, useful when having a reverse proxy handling auth in front of the API and/or the uchiwa dashboard (@danragnar) +- `templates/sensu-api-json.j2`, `templates/uchiwa_config.json.j2`: Check for explicitly defining sensu_uchiwa_users and sensu_api_user_name as empty to disable authentication, useful when having a reverse proxy handling auth in front of the API and/or the uchiwa dashboard (@danragnar) - `tasks/rabbit.yml`: Consistency of remote_src option for rabbitmq and sensu when copying SSL cert/key files. Useful if certificates are generated by another CA (e.g. FreeIPA) on the sensu host. (@danragnar) ## [2.0.0] - 2018-02-07 diff --git a/defaults/main.yml b/defaults/main.yml index 3a66b6be..c13943e8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -101,23 +101,23 @@ sensu_ssl_server_cacert: "{{ sensu_ssl_tool_base_path }}/sensu_ca/cacert.pem" sensu_ssl_server_cert: "{{ sensu_ssl_tool_base_path }}/server/cert.pem" sensu_ssl_server_key: "{{ sensu_ssl_tool_base_path }}/server/key.pem" dynamic_data_store: "{{ playbook_dir }}/data/store" -static_data_store: "{{ playbook_dir}}/data/static" +static_data_store: "{{ playbook_dir }}/data/static" # Uchiwa properties -uchiwa_dc_name: ~ -uchiwa_path: /opt/uchiwa -uchiwa_redis_use_ssl: false -uchiwa_users: +sensu_uchiwa_dc_name: ~ +sensu_uchiwa_path: /opt/uchiwa +sensu_uchiwa_redis_use_ssl: false +sensu_uchiwa_users: - username: admin password: admin -uchiwa_port: 3000 -uchiwa_refresh: 5 -uchiwa_sensu_api_port: "{{ sensu_api_port }}" -uchiwa_auth_privatekey: ~ -uchiwa_auth_publickey: ~ +sensu_uchiwa_port: 3000 +sensu_uchiwa_refresh: 5 +sensu_uchiwa_api_port: "{{ sensu_api_port }}" +sensu_uchiwa_auth_privatekey: ~ +sensu_uchiwa_auth_publickey: ~ # CentOS repository for redis and rabbitmq -centos_repository: epel +sensu_centos_repository: epel # Internal settings __bash_path: /bin/bash diff --git a/docs/role_variables.md b/docs/role_variables.md index bd1faf86..ec1bf23c 100644 --- a/docs/role_variables.md +++ b/docs/role_variables.md @@ -82,15 +82,15 @@ _Note: The above options are intended to provide users with flexibility. This al ### [Uchiwa Properties](https://docs.uchiwa.io/getting-started/configuration/) | Name | Default Value | Description | |--------------------|---------------|------------------------------| -| `uchiwa_dc_name` | _undefined_ | Datacenter name for Uchiwa instance | -| `uchiwa_path` | `/opt/uchiwa` | Path to the Uchiwa configuration directory | -| `uchiwa_redis_use_ssl` | `false` | Determines whether to use SSL for redis communication | -| `uchiwa_users`| [{username: admin, password: admin}] | The users to log into Uchiwa | -| `uchiwa_port` | 3000 | The TCP port to bind the Uchiwa web service to | -| `uchiwa_refresh` | 5 | The interval to pull the Sensu APIs in seconds | -| `uchiwa_sensu_api_port` | "{{ sensu_api_port }}" | Port for Uchiwa to communicate with the Sensu API. Change it if you have a load balancer/reverse proxy in front of the API servers listening on a different port than 4567. | -| `uchiwa_auth_privatekey` | None | If set, Uchiwa uses the key at this location for signing JWT token | -| `uchiwa_auth_publickey` | None | Public counterpart to the above variable | +| `sensu_uchiwa_dc_name` | _undefined_ | Datacenter name for Uchiwa instance | +| `sensu_uchiwa_path` | `/opt/uchiwa` | Path to the Uchiwa configuration directory | +| `sensu_uchiwa_redis_use_ssl` | `false` | Determines whether to use SSL for redis communication | +| `sensu_uchiwa_users`| [{username: admin, password: admin}] | The users to log into Uchiwa | +| `sensu_uchiwa_port` | 3000 | The TCP port to bind the Uchiwa web service to | +| `sensu_uchiwa_refresh` | 5 | The interval to pull the Sensu APIs in seconds | +| `sensu_uchiwa_api_port` | "{{ sensu_api_port }}" | Port for Uchiwa to communicate with the Sensu API. Change it if you have a load balancer/reverse proxy in front of the API servers listening on a different port than 4567. | +| `sensu_uchiwa_auth_privatekey` | None | If set, Uchiwa uses the key at this location for signing JWT token | +| `sensu_uchiwa_auth_publickey` | None | Public counterpart to the above variable | ## Ubuntu ### [redis Server Properties](https://docs.sensu.io/sensu-core/latest/reference/redis/) @@ -124,7 +124,7 @@ _Note: The above options are intended to provide users with flexibility. This al |--------------------|---------------|------------------------------| | `sensu_user_name` | root | The name of the Sensu service user | | `sensu_group_name` | root | The name of the Sensu service user's primary group | -| `centos_repository` | epel | The name of repository use for redis or rabbitmq packages. If it set as empty string, it's using the repository already enable on the node | +| `sensu_centos_repository` | epel | The name of repository use for redis or rabbitmq packages. If it set as empty string, it's using the repository already enable on the node | ## SmartOS diff --git a/docs/sensitive_info.md b/docs/sensitive_info.md index 044015c3..05c37a3d 100644 --- a/docs/sensitive_info.md +++ b/docs/sensitive_info.md @@ -14,7 +14,7 @@ As mentioned already throughout this documentation: Ansible really is quite vers Let's say we want to set the Uchiwa username and password for the node we have acting as the dashboard for our Sensu setup. If it were a host called `uchiwa.cmacr.ae`, we could set the following in `host_vars/uchiwa.cmacr.ae.yml`: ``` yaml -uchiwa_users: +sensu_uchiwa_users: - username: mordecai password: rigby ``` @@ -34,7 +34,7 @@ You don't have to set these variables directly in specific a node's variables. These could also be defined in, say, `vars/sensitive.yml` at the top of your Ansible codebase: ``` yaml -uchiwa_users: +sensu_uchiwa_users: - username: mordecai password: rigby sensu_api_user_name: muscleman @@ -50,5 +50,5 @@ Then, to ensure the variables are picked up during the play, you can add `vars/s ``` ### Editing encrypted data -Editing encrypted data is as easy as `$ ansible-vault edit path/to/data.yml` +Editing encrypted data is as easy as `$ ansible-vault edit path/to/data.yml` See [the Ansible Vault page for more information](https://docs.ansible.com/ansible/latest/user_guide/playbooks_vault.html) diff --git a/handlers/main.yml b/handlers/main.yml index fda3da41..4762243a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -61,7 +61,7 @@ - name: Build and deploy Uchiwa command: npm install --production args: - chdir: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa" + chdir: "{{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa" become: true become_user: "{{ sensu_user_name }}" diff --git a/tasks/CentOS/redis.yml b/tasks/CentOS/redis.yml index 8a5bf173..28a7bd02 100644 --- a/tasks/CentOS/redis.yml +++ b/tasks/CentOS/redis.yml @@ -19,7 +19,7 @@ yum: name: "{{ sensu_redis_pkg_name }}" state: "{{ sensu_redis_pkg_state }}" - enablerepo: "{{ centos_repository }}" + enablerepo: "{{ sensu_centos_repository }}" - name: Ensure redis binds to accessible IP tags: redis diff --git a/tasks/FreeBSD/dashboard.yml b/tasks/FreeBSD/dashboard.yml index 3e728de9..2b4d3311 100644 --- a/tasks/FreeBSD/dashboard.yml +++ b/tasks/FreeBSD/dashboard.yml @@ -20,7 +20,7 @@ - name: Ensure Uchiwa directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}" + dest: "{{ sensu_uchiwa_path }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -29,7 +29,7 @@ - name: Ensure Uchiwa Go/config directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/{{ item }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -41,7 +41,7 @@ - name: Ensure Uchiwa GOPATH exists tags: dashboard file: - dest: "{{ uchiwa_path }}/go/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/go/{{ item }}" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" state: directory @@ -55,9 +55,9 @@ tags: dashboard command: go get github.com/sensu/uchiwa environment: - GOPATH: "{{ uchiwa_path }}/go" + GOPATH: "{{ sensu_uchiwa_path }}/go" args: - creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa" + creates: "{{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa" notify: Build and deploy Uchiwa become: true become_user: "{{ sensu_user_name }}" @@ -69,7 +69,7 @@ tags: dashboard template: src: uchiwa_config.json.j2 - dest: "{{ uchiwa_path }}/etc/config.json" + dest: "{{ sensu_uchiwa_path }}/etc/config.json" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" notify: restart uchiwa service diff --git a/tasks/OpenBSD/dashboard.yml b/tasks/OpenBSD/dashboard.yml index c1231cee..a0735c68 100644 --- a/tasks/OpenBSD/dashboard.yml +++ b/tasks/OpenBSD/dashboard.yml @@ -20,7 +20,7 @@ - name: Ensure Uchiwa directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}" + dest: "{{ sensu_uchiwa_path }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -29,7 +29,7 @@ - name: Ensure Uchiwa Go/config directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/{{ item }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -41,7 +41,7 @@ - name: Ensure Uchiwa GOPATH exists tags: dashboard file: - dest: "{{ uchiwa_path }}/go/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/go/{{ item }}" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" state: directory @@ -55,9 +55,9 @@ tags: dashboard command: go get github.com/sensu/uchiwa environment: - GOPATH: "{{ uchiwa_path }}/go" + GOPATH: "{{ sensu_uchiwa_path }}/go" args: - creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa" + creates: "{{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa" notify: Build and deploy Uchiwa become: true become_user: "{{ sensu_user_name }}" @@ -69,7 +69,7 @@ tags: dashboard template: src: uchiwa_config.json.j2 - dest: "{{ uchiwa_path }}/etc/config.json" + dest: "{{ sensu_uchiwa_path }}/etc/config.json" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" notify: restart uchiwa service diff --git a/tasks/SmartOS/dashboard.yml b/tasks/SmartOS/dashboard.yml index 327ca97f..d4fad2e2 100644 --- a/tasks/SmartOS/dashboard.yml +++ b/tasks/SmartOS/dashboard.yml @@ -14,7 +14,7 @@ - name: Ensure Uchiwa directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}" + dest: "{{ sensu_uchiwa_path }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -23,7 +23,7 @@ - name: Ensure Uchiwa Go/config directory exists tags: dashboard file: - dest: "{{ uchiwa_path }}/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/{{ item }}" state: directory owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" @@ -35,7 +35,7 @@ - name: Ensure Uchiwa GOPATH exists tags: dashboard file: - dest: "{{ uchiwa_path }}/go/{{ item }}" + dest: "{{ sensu_uchiwa_path }}/go/{{ item }}" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" state: directory @@ -49,9 +49,9 @@ tags: dashboard command: go get github.com/sensu/uchiwa environment: - GOPATH: "{{ uchiwa_path }}/go" + GOPATH: "{{ sensu_uchiwa_path }}/go" args: - creates: "{{ uchiwa_path }}/go/src/github.com/sensu/uchiwa" + creates: "{{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa" notify: Build and deploy Uchiwa become: true become_user: "{{ sensu_user_name }}" @@ -63,7 +63,7 @@ tags: dashboard template: src: uchiwa_config.json.j2 - dest: "{{ uchiwa_path }}/etc/config.json" + dest: "{{ sensu_uchiwa_path }}/etc/config.json" owner: "{{ sensu_user_name }}" group: "{{ sensu_group_name }}" notify: restart uchiwa service diff --git a/templates/sensu_enterprise_dashboard_config.json.j2 b/templates/sensu_enterprise_dashboard_config.json.j2 index 4c08bff8..928ba243 100644 --- a/templates/sensu_enterprise_dashboard_config.json.j2 +++ b/templates/sensu_enterprise_dashboard_config.json.j2 @@ -1,10 +1,10 @@ { "sensu": [ { - "name": "{{ uchiwa_dc_name }}", + "name": "{{ sensu_uchiwa_dc_name }}", "host": "{{ sensu_api_host }}", "ssl": {{ sensu_api_ssl }}, - "port": {{ uchiwa_sensu_api_port }}, + "port": {{ sensu_uchiwa_api_port }}, "user": "{{ sensu_api_user_name }}", "pass": "{{ sensu_api_password }}", "path": "{{ sensu_api_uchiwa_path }}", @@ -12,8 +12,8 @@ } ], "dashboard": { - "users": {{ uchiwa_users | to_nice_json }}, - "port": {{ uchiwa_port }}, - "refresh": {{ uchiwa_refresh }} + "users": {{ sensu_uchiwa_users | to_nice_json }}, + "port": {{ sensu_uchiwa_port }}, + "refresh": {{ sensu_uchiwa_refresh }} } } diff --git a/templates/uchiwa.sh.j2 b/templates/uchiwa.sh.j2 index cfc15263..237eee0a 100644 --- a/templates/uchiwa.sh.j2 +++ b/templates/uchiwa.sh.j2 @@ -8,7 +8,7 @@ set -o xtrace . /lib/svc/share/smf_include.sh -HOME={{ uchiwa_path }} +HOME={{ sensu_uchiwa_path }} UCHIWA_PATH=${HOME}/go/src/github.com/sensu/uchiwa UCHIWA_USER={{ sensu_user_name }} diff --git a/templates/uchiwa.smartos_smf_manifest.xml.j2 b/templates/uchiwa.smartos_smf_manifest.xml.j2 index a93cf386..726c30d2 100644 --- a/templates/uchiwa.smartos_smf_manifest.xml.j2 +++ b/templates/uchiwa.smartos_smf_manifest.xml.j2 @@ -13,7 +13,7 @@ - + diff --git a/templates/uchiwa_config.json.j2 b/templates/uchiwa_config.json.j2 index f2c39203..d32c8f1d 100644 --- a/templates/uchiwa_config.json.j2 +++ b/templates/uchiwa_config.json.j2 @@ -1,10 +1,10 @@ { "sensu": [ { - "name": "{{ uchiwa_dc_name }}", + "name": "{{ sensu_uchiwa_dc_name }}", "host": "{{ sensu_api_host }}", "ssl": {{ sensu_api_ssl | lower }}, - "port": {{ uchiwa_sensu_api_port }}, + "port": {{ sensu_uchiwa_api_port }}, {% if sensu_api_user_name %} "user": "{{ sensu_api_user_name }}", "pass": "{{ sensu_api_password }}", @@ -14,16 +14,16 @@ } ], "uchiwa": { - {% if uchiwa_users %} - "users": {{ uchiwa_users | to_nice_json }}, + {% if sensu_uchiwa_users %} + "users": {{ sensu_uchiwa_users | to_nice_json }}, {% endif %} - "port": {{ uchiwa_port }}, - {% if uchiwa_auth_privatekey %} + "port": {{ sensu_uchiwa_port }}, + {% if sensu_uchiwa_auth_privatekey %} "auth": { - "privatekey": "{{ uchiwa_auth_privatekey }}", - "publickey": "{{ uchiwa_auth_publickey }}" + "privatekey": "{{ sensu_uchiwa_auth_privatekey }}", + "publickey": "{{ sensu_uchiwa_auth_publickey }}" }, {% endif %} - "refresh": {{ uchiwa_refresh }} + "refresh": {{ sensu_uchiwa_refresh }} } } diff --git a/templates/uchiwa_freebsd.j2 b/templates/uchiwa_freebsd.j2 index 88bde7d9..6f5f3145 100644 --- a/templates/uchiwa_freebsd.j2 +++ b/templates/uchiwa_freebsd.j2 @@ -5,8 +5,8 @@ name=uchiwa rcvar=uchiwa_enable -command="{{ uchiwa_path }}/go/bin/${name}" -uchiwa_flags="-d {{ uchiwa_path }} -c {{ uchiwa_path }}/etc/config.json -p {{ uchiwa_path }}/go/src/github.com/sensu/uchiwa/public" +command="{{ sensu_uchiwa_path }}/go/bin/${name}" +uchiwa_flags="-d {{ sensu_uchiwa_path }} -c {{ sensu_uchiwa_path }}/etc/config.json -p {{ sensu_uchiwa_path }}/go/src/github.com/sensu/uchiwa/public" load_rc_config $name