Просмотр исходного кода

Add config values for Uchiwa's auth priv/pubkeys

Stephen Muth 8 лет назад
Родитель
Сommit
b6f3313a8e
3 измененных файлов с 10 добавлено и 0 удалено
  1. 2 0
      defaults/main.yml
  2. 2 0
      docs/role_variables.md
  3. 6 0
      templates/uchiwa_config.json.j2

+ 2 - 0
defaults/main.yml

@@ -97,6 +97,8 @@ uchiwa_users:
 uchiwa_port: 3000
 uchiwa_refresh: 5
 uchiwa_sensu_api_port: "{{ sensu_api_port }}"
+uchiwa_auth_privatekey: ~
+uchiwa_auth_publickey: ~
 
 # CentOS repository for redis and rabbitmq
 centos_repository: epel

+ 2 - 0
docs/role_variables.md

@@ -81,6 +81,8 @@ _Note: The above options are intended to provide users with flexibility. This al
 | `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 |
 
 ## Ubuntu
 ### [redis Server Properties](https://sensuapp.org/docs/latest/reference/redis)

+ 6 - 0
templates/uchiwa_config.json.j2

@@ -14,6 +14,12 @@
  "uchiwa": {
    "users": {{ uchiwa_users | to_nice_json }},
    "port": {{ uchiwa_port }},
+   {% if uchiwa_auth_privatekey %}
+   "auth": {
+     "privatekey": "{{ uchiwa_auth_privatekey }}",
+     "publickey": "{{ uchiwa_auth_publickey }}"
+   },
+   {% endif %}
    "refresh": {{ uchiwa_refresh }}
   }
 }