From 78fd73bd48f3e295f1cce8fffb399084a8ea00a2 Mon Sep 17 00:00:00 2001 From: Michael Porter Date: Mon, 18 Feb 2019 19:53:39 -0500 Subject: [PATCH] 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