Explorar o código

Added a sensu_client variable that determines whether the client config should be deployed to a machine

Tyler Culp %!s(int64=8) %!d(string=hai) anos
pai
achega
c181cd0f70
Modificáronse 3 ficheiros con 7 adicións e 0 borrados
  1. 1 0
      defaults/main.yml
  2. 1 0
      docs/role_variables.md
  3. 5 0
      tasks/main.yml

+ 1 - 0
defaults/main.yml

@@ -73,6 +73,7 @@ sensu_group_name: sensu
 sensu_include_plugins: true
 sensu_include_dashboard: false
 sensu_master: false
+sensu_client: true
 sensu_user_name: sensu
 sensu_remote_plugins: ~
 sensu_transport: rabbitmq

+ 1 - 0
docs/role_variables.md

@@ -53,6 +53,7 @@ _Note: The above options are intended to provide users with flexibility. This al
 | `sensu_include_plugins` | `true` | Determines whether to include the `sensu-plugins` gem |
 | `sensu_include_dashboard` | `false` | Determines whether to deploy the Uchiwa dashboard |
 | `sensu_master` | `false` | Determines if a node is to act as the Sensu "master" node |
+| `sensu_client` | `true` | Determines if a node should be given the sensu client config |
 | `sensu_user_name`| sensu | The name of the Sensu service user |
 | `sensu_group_name` | sensu | The name of the Sensu service user's primary group |
 | `sensu_remote_plugins` | _undefined_ | A list of plugins to install via `sensu-install` (Ruby Gems) |

+ 5 - 0
tasks/main.yml

@@ -5,6 +5,8 @@
 
   - include: "{{ role_path }}/tasks/{{ ansible_distribution }}/main.yml"
     tags: setup
+    when: sensu_master
+          or sensu_client
 
   - include: "{{ role_path }}/tasks/redis.yml"
     tags: redis
@@ -23,6 +25,8 @@
 
   - include: "{{ role_path }}/tasks/common.yml"
     tags: common
+    when: sensu_master
+          or sensu_client
 
   - include: "{{ role_path }}/tasks/server.yml"
     tags: server
@@ -36,6 +40,7 @@
 
   - include: "{{ role_path }}/tasks/client.yml"
     tags: client
+    when: sensu_client
 
   - include: "{{ role_path }}/tasks/plugins.yml"
     tags: plugins