Selaa lähdekoodia

Split sensu_deploy_redis and sensu_deploy_rabbitmq to variables for deploying each server and the configurations on sensu hosts

Tyler Culp 8 vuotta sitten
vanhempi
commit
347afa18fd
5 muutettua tiedostoa jossa 17 lisäystä ja 9 poistoa
  1. 5 2
      defaults/main.yml
  2. 2 2
      docs/integration.md
  3. 5 2
      docs/role_variables.md
  4. 3 1
      tasks/common.yml
  5. 2 2
      tasks/main.yml

+ 5 - 2
defaults/main.yml

@@ -26,8 +26,8 @@ sensu_enterprise_dashboard_service_name: sensu-enterprise-dashboard
 uchiwa_service_name: uchiwa
 
 # Service deployment options
-sensu_deploy_rabbitmq: true
-sensu_deploy_redis: true
+sensu_deploy_rabbitmq_server: true
+sensu_deploy_redis_server: true
 
 # RabbitMQ server properties
 rabbitmq_config_path: /etc/rabbitmq
@@ -78,6 +78,9 @@ sensu_remote_plugins: ~
 sensu_transport: rabbitmq
 sensu_client_name: "{{ ansible_hostname }}"
 sensu_client_subscriptions: "{{ group_names }}"
+sensu_deploy_rabbitmq_config: true
+sensu_deploy_redis_config: true
+sensu_deploy_transport_config: true
 
 # Sensu/RabbitMQ SSL certificate properties
 sensu_ssl_gen_certs: true

+ 2 - 2
docs/integration.md

@@ -6,7 +6,7 @@ RabbitMQ
 --------
 If you'd like to use a different role/management method for RabbitMQ, the following variables are of interest:
 ``` yaml
-sensu_deploy_rabbitmq: false
+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 >
@@ -22,7 +22,7 @@ redis
 -----
 If you'd like to use a different role/management method for redis, the following vairables are of interest:
 ``` yaml
-sensu_deploy_redis: false
+sensu_deploy_redis_server: false
 redis_host: < IP/DNS record of your redis server >
 redis_port: < optionally set a differing port, defaults to 6379 >
 ```

+ 5 - 2
docs/role_variables.md

@@ -4,8 +4,8 @@
 ### Service Deployment Options
 | Name               | Default Value | Description                  |
 |--------------------|---------------|------------------------------|
-|`sensu_deploy_rabbitmq` | `true`    | Determines whether or not to use this role to deploy/configure RabbitMQ |
-|`sensu_deploy_redis`    | `true`    | Determines whether or not to use this role to deploy/configure redis |
+|`sensu_deploy_rabbitmq_server` | `true`    | Determines whether or not to use this role to deploy/configure RabbitMQ server |
+|`sensu_deploy_redis_server`    | `true`    | Determines whether or not to use this role to deploy/configure redis server |
 
 _Note: The above options are intended to provide users with flexibility. This allows the use of other roles for deployment of these services._
 
@@ -58,6 +58,9 @@ _Note: The above options are intended to provide users with flexibility. This al
 | `sensu_remote_plugins` | _undefined_ | A list of plugins to install via `sensu-install` (Ruby Gems) |
 | `sensu_client_name` | `"{{ ansible_hostname }}"` | Sensu client identification (for display purposes) |
 | `sensu_client_subscriptions` | `"{{ group_names }}"` | Sensu client subscriptions |
+| `sensu_deploy_rabbitmq_config` | `true`    | Determines whether or not to deploy RabbitMQ config for sensu |
+| `sensu_deploy_redis_config`    | `true`    | Determines whether or not to deploy redis config for sensu |
+| `sensu_deploy_transport_config`    | `true`    | Determines whether or not to deploy transport config for sensu |
 
 ### Sensu/RabbitMQ SSL certificate properties
 | `sensu_ssl_gen_certs` | `true` | Determines when this role generates its own SSL certs |

+ 3 - 1
tasks/common.yml

@@ -16,7 +16,7 @@
       owner: "{{ sensu_user_name }}"
       group: "{{ sensu_group_name }}"
       src: "{{ sensu_redis_config }}"
-    when: sensu_deploy_redis
+    when: sensu_deploy_redis_config
     notify:
       - restart sensu-server service
       - restart sensu-api service
@@ -30,6 +30,7 @@
       group: "{{ sensu_group_name }}"
       src: "{{ sensu_rabbitmq_config }}"
     when: sensu_transport == "rabbitmq"
+          and sensu_deploy_rabbitmq_config
     notify:
       - restart sensu-server service
       - restart sensu-api service
@@ -42,6 +43,7 @@
       owner: "{{ sensu_user_name }}"
       group: "{{ sensu_group_name }}"
       src: transport.json.j2
+    when: sensu_deploy_transport_config
     notify:
       - restart sensu-server service
       - restart sensu-api service

+ 2 - 2
tasks/main.yml

@@ -9,7 +9,7 @@
   - include: "{{ role_path }}/tasks/redis.yml"
     tags: redis
     when: redis_server
-          and sensu_deploy_redis
+          and sensu_deploy_redis_server
     static: false
 
   - include: "{{ role_path }}/tasks/ssl.yml"
@@ -18,7 +18,7 @@
   - include: "{{ role_path }}/tasks/rabbit.yml"
     tags: rabbitmq
     when: rabbitmq_server
-          and sensu_deploy_rabbitmq
+          and sensu_deploy_rabbitmq_server
     static: false
 
   - include: "{{ role_path }}/tasks/common.yml"