-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-explorer.yaml
57 lines (50 loc) · 1.51 KB
/
install-explorer.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
---
- name: install the block explorer
hosts: api
remote_user: root
tasks:
- name: Install nginx
ansible.builtin.package:
name:
- nginx
state: latest
- name: clone block explorer
git: repo=https://github.com/etherparty/explorer dest=~/explorer force=true
become: yes
become_user: app
- name: start the block explorer
shell: >
/bin/bash -c "sed -i 's/localhost/{{ inventory_hostname }}/g' package.json && sed -i 's/localhost/{{ inventory_hostname }}/g' app/app.js"
args:
chdir: ~/explorer
become: yes
become_user: app
- name: install packages
command: npm install
args:
chdir: ~/dyneth
become: yes
become_user: app
- name: Configuration for nginx
blockinfile:
dest: /etc/nginx/sites-enabled/explorer
create: true
block: |
server {
listen 8000 default_server;
listen [::]:8000 default_server;
server_name _;
root /home/app/explorer/app;
include /etc/nginx/mime.types;
location ~ ^/tx/(.*) {
return 301 $scheme://test.fabchain.net:8000/#/transaction/$1;
}
location / {
try_files $uri /index.html;
}
}
- name: Restart nginx
ansible.builtin.systemd:
state: restarted
daemon_reload: yes
name: nginx