Ver Fonte

Re-implementing `sensu_master_config_path` by @smuth4

cmacrae há 9 anos atrás
pai
commit
4094445dad
3 ficheiros alterados com 15 adições e 1 exclusões
  1. 2 1
      defaults/main.yml
  2. 12 0
      docs/differing_master_environment.md
  3. 1 0
      mkdocs.yml

+ 2 - 1
defaults/main.yml

@@ -46,7 +46,8 @@ sensu_remote_plugins: ~
 
 # Sensu/RabbitMQ SSL certificate properties
 sensu_ssl_gen_certs: true
-sensu_ssl_tool_base_path: "{{ dynamic_data_store }}/{{ groups['sensu_masters'][0] }}{{ sensu_config_path }}/ssl_generation/sensu_ssl_tool"
+sensu_master_config_path: "{{ hostvars[groups['sensu_masters'][0]]['sensu_config_path'] | default('/etc/sensu') }}"
+sensu_ssl_tool_base_path: "{{ dynamic_data_store }}/{{ groups['sensu_masters'][0] }}{{ sensu_master_config_path }}/ssl_generation/sensu_ssl_tool"
 sensu_ssl_client_cert: "{{ sensu_ssl_tool_base_path }}/client/cert.pem"
 sensu_ssl_client_key: "{{ sensu_ssl_tool_base_path }}/client/key.pem"
 sensu_ssl_server_cacert: "{{ sensu_ssl_tool_base_path }}/sensu_ca/cacert.pem"

+ 12 - 0
docs/differing_master_environment.md

@@ -0,0 +1,12 @@
+Differing Master Environment
+----------------------------
+If the system you're hosting as your Sensu "master" has a differing environment to that of some or all of your client systems - perhaps due to a different operating system, or simply down to preference - you'll need to set the variable `sensu_master_config_path` for that system at the `host_vars` level to point to its configuration directory.  
+
+Let's say my Sensu "master" is running in a SmartOS zone, but my clients are mostly Linux systems. I'd need to set the following in the "master" system's `host_vars`:
+``` yaml
+---
+sensu_master_config_path: '/opt/local/etc/sensu'
+```
+
+This is necessary for the deployment of SSL data to the clients. When distributing the SSL data to the clients, a lookup is used to get the path to the data, which uses the above variable.  
+If `sensu_master_config_path` is not defined at the "master" node's `host_vars` level, a default of `/etc/sensu` will be used.

+ 1 - 0
mkdocs.yml

@@ -10,6 +10,7 @@ pages:
   - [ 'role_variables.md', 'Usage', 'Role variables' ]
   - [ 'example_infra.md', 'Usage', 'Example infrastructure layout' ]
   - [ 'single_master.md', 'Usage', 'Deploy the stack to a single node' ]
+  - [ 'differing_master_environment.md', 'Usage', 'A differing master environment' ]
   - [ 'custom_client_config.md', 'Usage', 'Custom client configuration' ]
   - [ 'deploy_plugins.md', 'Usage', 'Deployment of handlers/filters/mutators' ]
   - [ 'remote_plugins.md', 'Usage', 'Remote plugin deployment']