Skip to content

Commit

Permalink
chore(namespace) Update uchiwa_ namespace to sensu_uchiwa_
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpporter committed Feb 19, 2019
1 parent 7484a34 commit 78fd73b
Show file tree
Hide file tree
Showing 14 changed files with 63 additions and 63 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 10 additions & 10 deletions docs/role_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/sensitive_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
Expand All @@ -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)
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"

Expand Down
2 changes: 1 addition & 1 deletion tasks/CentOS/redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tasks/FreeBSD/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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
Expand All @@ -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 }}"
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tasks/OpenBSD/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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
Expand All @@ -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 }}"
Expand All @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tasks/SmartOS/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand All @@ -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 }}"
Expand All @@ -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
Expand All @@ -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 }}"
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions templates/sensu_enterprise_dashboard_config.json.j2
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"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 }}",
"timeout": {{ sensu_api_timeout }}
}
],
"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 }}
}
}
2 changes: 1 addition & 1 deletion templates/uchiwa.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}

Expand Down
2 changes: 1 addition & 1 deletion templates/uchiwa.smartos_smf_manifest.xml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<method_context>
<method_credential user="{{ sensu_user_name }}" group="{{ sensu_user_name }}" />
<method_environment>
<envvar name="HOME" value="{{ uchiwa_path }}" />
<envvar name="HOME" value="{{ sensu_uchiwa_path }}" />
<envvar name="PATH" value="/opt/uchiwa/go/bin:/opt/local/sbin:/opt/local/bin:/sbin:/usr/sbin:/usr/bin" />
</method_environment>
</method_context>
Expand Down
18 changes: 9 additions & 9 deletions templates/uchiwa_config.json.j2
Original file line number Diff line number Diff line change
@@ -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 }}",
Expand All @@ -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 }}
}
}
4 changes: 2 additions & 2 deletions templates/uchiwa_freebsd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 78fd73b

Please sign in to comment.