From c87c63c0142424196766261f3b868dc5fdb882cb Mon Sep 17 00:00:00 2001 From: gurbirkalsi Date: Mon, 7 Dec 2020 16:27:38 -0500 Subject: [PATCH] Update Ansible configuration for deploying dashboard using environment variables --- ansible/README.md | 9 ++----- ansible/config.json.j2 | 1 - ansible/inventory | 25 +++---------------- ansible/roles/dashboard-deploy/tasks/main.yml | 4 +-- config.json.j2 | 8 ------ 5 files changed, 6 insertions(+), 41 deletions(-) delete mode 120000 ansible/config.json.j2 delete mode 100644 config.json.j2 diff --git a/ansible/README.md b/ansible/README.md index fa2cc668c..429a035fc 100644 --- a/ansible/README.md +++ b/ansible/README.md @@ -3,17 +3,12 @@ This will ease installation, and deployment of the pbench dashboard. ## Required - Ansible needs to be installed on the host where you want to run this playbook -- An inventory file containing the following key values defined: - - "`elasticsearch_url`", "`results_url`", "`graphql_url`", "`run_index`", "`prefix`" - See the `/README.md` for more details. +- An inventory file containing the server values defined ## Run Running the below commands from this checked-out directory to install the pbench dashboard components locally, and then deploy hosts mentioned under -the "`[servers:children]`" section of the given `inventory` file. - -There's also an option to define the dashboard configuration in the provided -inventory file. +the "`[servers]`" section of the given `inventory` file. See the `inventory` file in this directory for an example. ``` diff --git a/ansible/config.json.j2 b/ansible/config.json.j2 deleted file mode 120000 index 2f0c04d24..000000000 --- a/ansible/config.json.j2 +++ /dev/null @@ -1 +0,0 @@ -../config.json.j2 \ No newline at end of file diff --git a/ansible/inventory b/ansible/inventory index 9508f7761..19e746ac7 100644 --- a/ansible/inventory +++ b/ansible/inventory @@ -1,22 +1,3 @@ -[servers:children] -ui-server -user-server - -[servers:vars] -results_url="http://{{ inventory_hostname }}" -run_index="run.example" -graphql_url="http://{{ inventory_hostname }}" - -[ui-server] -ui-server.example.com - -[ui-server:vars] -elasticsearch_url="http://elasticsearch.example.com" -prefix="ui-server.example." - -[user-server] -user-server.example.com - -[user-server:vars] -elasticsearch_url="http://elasticsearch.example.com" -prefix="user-server.example." +[servers] +staging-server.example.com +production-server.example.com diff --git a/ansible/roles/dashboard-deploy/tasks/main.yml b/ansible/roles/dashboard-deploy/tasks/main.yml index beed689a8..bdba9135d 100644 --- a/ansible/roles/dashboard-deploy/tasks/main.yml +++ b/ansible/roles/dashboard-deploy/tasks/main.yml @@ -13,6 +13,4 @@ dest: /var/www/html/dashboard owner: pbench group: pbench - -- name: initialize dashboard config file - template: src=config.json.j2 dest=/var/www/html/dashboard/config.json mode=0644 owner=pbench group=pbench + \ No newline at end of file diff --git a/config.json.j2 b/config.json.j2 deleted file mode 100644 index 51d96b714..000000000 --- a/config.json.j2 +++ /dev/null @@ -1,8 +0,0 @@ -{ - "elasticsearch": "{{ elasticsearch_url }}", - "results": "{{ results_url }}", - "graphql": "{{ graphql_url }}", - "result_index": "{{ result_index }}", - "run_index": "{{ run_index }}", - "prefix": "{{ prefix }}" -}