Skip to content
This repository was archived by the owner on Aug 31, 2022. It is now read-only.

Commit 17b302c

Browse files
committed
Update Ansible configuration for deploying dashboard using environment
variables
1 parent 1f51ae4 commit 17b302c

File tree

5 files changed

+12
-41
lines changed

5 files changed

+12
-41
lines changed

ansible/README.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@ This will ease installation, and deployment of the pbench dashboard.
33

44
## Required
55
- Ansible needs to be installed on the host where you want to run this playbook
6-
- An inventory file containing the following key values defined:
7-
- "`elasticsearch_url`", "`results_url`", "`graphql_url`", "`run_index`", "`prefix`"
8-
See the `/README.md` for more details.
6+
- An inventory file containing the server values defined
7+
8+
## Endpoint Configuration
9+
API endpoints are configured and bundled into the final binary when running `yarn build`. Before deployment of the binary to a remote host, consider the current configuration definition at `config/endpoints.js`.
910

1011
## Run
1112
Running the below commands from this checked-out directory to install the
1213
pbench dashboard components locally, and then deploy hosts mentioned under
13-
the "`[servers:children]`" section of the given `inventory` file.
14-
15-
There's also an option to define the dashboard configuration in the provided
16-
inventory file.
14+
the "`[servers]`" section of the given `inventory` file.
1715

1816
See the `inventory` file in this directory for an example.
1917
```
18+
$ # First bundle the dashboard for production
19+
$ yarn build
20+
$
2021
$ # First add a link to the "dist" folder where the dashboard will be built.
2122
$ ln -sf ../dist dist
2223
$ ansible-playbook -i inventory dashboard-install.yml

ansible/config.json.j2

-1
This file was deleted.

ansible/inventory

+3-22
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,3 @@
1-
[servers:children]
2-
ui-server
3-
user-server
4-
5-
[servers:vars]
6-
results_url="http://{{ inventory_hostname }}"
7-
run_index="run.example"
8-
graphql_url="http://{{ inventory_hostname }}"
9-
10-
[ui-server]
11-
ui-server.example.com
12-
13-
[ui-server:vars]
14-
elasticsearch_url="http://elasticsearch.example.com"
15-
prefix="ui-server.example."
16-
17-
[user-server]
18-
user-server.example.com
19-
20-
[user-server:vars]
21-
elasticsearch_url="http://elasticsearch.example.com"
22-
prefix="user-server.example."
1+
[servers]
2+
staging-server.example.com
3+
production-server.example.com

ansible/roles/dashboard-deploy/tasks/main.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,4 @@
1313
dest: /var/www/html/dashboard
1414
owner: pbench
1515
group: pbench
16-
17-
- name: initialize dashboard config file
18-
template: src=config.json.j2 dest=/var/www/html/dashboard/config.json mode=0644 owner=pbench group=pbench
16+

config.json.j2

-8
This file was deleted.

0 commit comments

Comments
 (0)