diff --git a/roles/bootnode/defaults/main.yml b/roles/bootnode/defaults/main.yml index 60c69c8..8778241 100644 --- a/roles/bootnode/defaults/main.yml +++ b/roles/bootnode/defaults/main.yml @@ -1,5 +1,7 @@ --- +user: ubuntu + allow_bootnode_ssh: true allow_bootnode_p2p: true allow_bootnode_rpc: false \ No newline at end of file diff --git a/roles/explorer/defaults/main.yml b/roles/explorer/defaults/main.yml index 287e61d..900abe5 100644 --- a/roles/explorer/defaults/main.yml +++ b/roles/explorer/defaults/main.yml @@ -1,5 +1,7 @@ ----- +user: ubuntu + allow_explorer_ssh: true allow_explorer_p2p: true allow_explorer_http: true \ No newline at end of file diff --git a/roles/explorer/templates/app.json.j2 b/roles/explorer/templates/app.json.j2 index e0ca3dd..20467dd 100644 --- a/roles/explorer/templates/app.json.j2 +++ b/roles/explorer/templates/app.json.j2 @@ -3,8 +3,8 @@ "name" : "explorer", "script" : "./bin/www", "log_date_format" : "YYYY-MM-DD HH:mm:SS Z", - "error_file" : "/home/{{ username }}/logs/explorer.err", - "out_file" : "/home/{{ username }}/logs/explorer.out", + "error_file" : "{{ home }}/logs/explorer.err", + "out_file" : "{{ home }}/logs/explorer.out", "merge_logs" : false, "watch" : false, "max_restarts" : 100, diff --git a/roles/explorer/templates/config.js.j2 b/roles/explorer/templates/config.js.j2 index e6fe8a8..2e86b0f 100644 --- a/roles/explorer/templates/config.js.j2 +++ b/roles/explorer/templates/config.js.j2 @@ -2,7 +2,7 @@ var web3 = require('web3'); var net = require('net'); var config = function () { this.logFormat = "combined"; - this.ipcPath = "/home/{{ username }}/parity_data/jsonrpc.ipc"; + this.ipcPath = "{{ home }}/parity_data/jsonrpc.ipc"; this.provider = new web3.providers.IpcProvider(this.ipcPath, net); this.bootstrapUrl = "https://maxcdn.bootstrapcdn.com/bootswatch/3.3.7/yeti/bootstrap.min.css"; this.names = { diff --git a/roles/explorer/templates/poa-chain-explorer.j2 b/roles/explorer/templates/poa-chain-explorer.j2 index f0fda63..a8465d2 100644 --- a/roles/explorer/templates/poa-chain-explorer.j2 +++ b/roles/explorer/templates/poa-chain-explorer.j2 @@ -7,7 +7,7 @@ RemainAfterExit=true User={{ username }} Group={{ username }} Environment=MYVAR=myval -WorkingDirectory=/home/{{ username }}/chain-explorer +WorkingDirectory={{ home }}/chain-explorer ExecStart=/usr/bin/pm2 startOrRestart app.json [Install] WantedBy=multi-user.target diff --git a/roles/moc/defaults/main.yml b/roles/moc/defaults/main.yml index ba5ed06..d2d1493 100644 --- a/roles/moc/defaults/main.yml +++ b/roles/moc/defaults/main.yml @@ -1,4 +1,6 @@ --- +user: ubuntu + allow_moc_ssh: true allow_moc_p2p: true \ No newline at end of file diff --git a/roles/netstat/defaults/main.yml b/roles/netstat/defaults/main.yml index 1871848..8baa5df 100644 --- a/roles/netstat/defaults/main.yml +++ b/roles/netstat/defaults/main.yml @@ -1,4 +1,6 @@ --- +user: ubuntu + allow_netstat_ssh: true allow_netstat_http: true diff --git a/roles/netstat/tasks/main.yml b/roles/netstat/tasks/main.yml index 119bc17..c6417d8 100644 --- a/roles/netstat/tasks/main.yml +++ b/roles/netstat/tasks/main.yml @@ -11,7 +11,7 @@ - name: install npm netstats npm: - path: "/home/{{ username }}/eth-netstats" + path: "{{ home }}/eth-netstats" become: true become_user: "{{ username }}" notify: @@ -23,16 +23,16 @@ global: yes - name: run grunt process - shell: "cd /home/{{ username }}/eth-netstats; grunt" + shell: "cd {{ home }}/eth-netstats; grunt" become: true become_user: "{{ username }}" args: - creates: "/home/{{ username }}/dist" + creates: "{{ home }}/dist" - name: Config ws_secret.json file copy: content: '["{{ NETSTATS_SECRET }}"]' - dest: "/home/{{ username }}/eth-netstats/ws_secret.json" + dest: "{{ home }}/eth-netstats/ws_secret.json" notify: - restart poa-dashboard diff --git a/roles/netstat/templates/poa-dashboard.j2 b/roles/netstat/templates/poa-dashboard.j2 index f6546f2..8e35c6a 100644 --- a/roles/netstat/templates/poa-dashboard.j2 +++ b/roles/netstat/templates/poa-dashboard.j2 @@ -5,7 +5,7 @@ After=network.target User={{ username }} Group={{ username }} Environment=MYVAR=myval -WorkingDirectory=/home/{{ username }}/eth-netstats +WorkingDirectory={{ home }}/eth-netstats Restart=always ExecStart=/usr/bin/npm start [Install] diff --git a/roles/poa-logrotate/templates/poa-logrotate.conf.j2 b/roles/poa-logrotate/templates/poa-logrotate.conf.j2 index 865e394..1716c7b 100644 --- a/roles/poa-logrotate/templates/poa-logrotate.conf.j2 +++ b/roles/poa-logrotate/templates/poa-logrotate.conf.j2 @@ -1,4 +1,4 @@ -/home/{{ username }}/logs/*.log { +{{ home }}/logs/*.log { rotate 10 size 200M missingok @@ -9,7 +9,7 @@ olddir old } -/home/{{ username }}/logs/*.err { +{{ home }}/logs/*.err { rotate 10 size 200M missingok @@ -20,7 +20,7 @@ olddir old } -/home/{{ username }}/logs/*.out { +{{ home }}/logs/*.out { rotate 10 size 200M missingok @@ -31,7 +31,7 @@ olddir old } -/home/{{ username }}/.pm2/pm2.log { +{{ home }}/.pm2/pm2.log { su {{ username }} {{ username }} rotate 10 size 200M diff --git a/roles/poa-logrotate/templates/poa-logrotate.j2 b/roles/poa-logrotate/templates/poa-logrotate.j2 index c20dff4..8b67e39 100644 --- a/roles/poa-logrotate/templates/poa-logrotate.j2 +++ b/roles/poa-logrotate/templates/poa-logrotate.j2 @@ -1,2 +1,2 @@ #!/bin/bash -/usr/sbin/logrotate /home/{{ username }}/poa-logrotate.conf +/usr/sbin/logrotate {{ home }}/poa-logrotate.conf diff --git a/roles/poa-netstats/tasks/main.yml b/roles/poa-netstats/tasks/main.yml index da4d1a4..529eb4c 100644 --- a/roles/poa-netstats/tasks/main.yml +++ b/roles/poa-netstats/tasks/main.yml @@ -31,7 +31,7 @@ - name: install npm netstats npm: - path: "/home/{{ username }}/eth-net-intelligence-api" + path: "{{ home }}/eth-net-intelligence-api" become: true become_user: "{{ username }}" notify: diff --git a/roles/poa-netstats/templates/app.json.j2 b/roles/poa-netstats/templates/app.json.j2 index 47a99c3..1182744 100644 --- a/roles/poa-netstats/templates/app.json.j2 +++ b/roles/poa-netstats/templates/app.json.j2 @@ -3,8 +3,8 @@ "name" : "netstats_daemon", "script" : "app.js", "log_date_format" : "YYYY-MM-DD HH:mm:SS Z", - "error_file" : "/home/{{ username }}/logs/netstats_daemon.err", - "out_file" : "/home/{{ username }}/logs/netstats_daemon.out", + "error_file" : "{{ home }}/logs/netstats_daemon.err", + "out_file" : "{{ home }}/logs/netstats_daemon.out", "merge_logs" : false, "watch" : false, "max_restarts" : 100, diff --git a/roles/poa-netstats/templates/poa-netstats.j2 b/roles/poa-netstats/templates/poa-netstats.j2 index c76cbb6..6b160fc 100644 --- a/roles/poa-netstats/templates/poa-netstats.j2 +++ b/roles/poa-netstats/templates/poa-netstats.j2 @@ -7,7 +7,7 @@ RemainAfterExit=true User={{ username }} Group={{ username }} Environment=MYVAR=myval -WorkingDirectory=/home/{{ username }}/eth-net-intelligence-api +WorkingDirectory={{ home }}/eth-net-intelligence-api ExecStart=/usr/bin/pm2 startOrRestart app.json [Install] WantedBy=multi-user.target diff --git a/roles/poa-orchestrator/templates/poa-orchestrator.j2 b/roles/poa-orchestrator/templates/poa-orchestrator.j2 index 2f98456..c7236cc 100644 --- a/roles/poa-orchestrator/templates/poa-orchestrator.j2 +++ b/roles/poa-orchestrator/templates/poa-orchestrator.j2 @@ -4,7 +4,7 @@ After=poa-parity.service [Service] User={{ username }} Group={{ username }} -WorkingDirectory=/home/{{ username }} -ExecStart=/home/{{ username }}/parity-orchestrator --config=parity-orchestrator.toml +WorkingDirectory={{ home }} +ExecStart={{ home }}/parity-orchestrator --config=parity-orchestrator.toml [Install] WantedBy=multi-user.target diff --git a/roles/poa-parity/templates/app_chain_explorer.json.j2 b/roles/poa-parity/templates/app_chain_explorer.json.j2 index b07d1b9..5b6c957 100644 --- a/roles/poa-parity/templates/app_chain_explorer.json.j2 +++ b/roles/poa-parity/templates/app_chain_explorer.json.j2 @@ -3,8 +3,8 @@ "name" : "explorer", "script" : "./bin/www", "log_date_format" : "YYYY-MM-DD HH:mm:SS Z", - "error_file" : "/home/{{ username }}/logs/explorer.err", - "out_file" : "/home/{{ username }}/logs/explorer.out", + "error_file" : "{{ home }}/logs/explorer.err", + "out_file" : "{{ home }}/logs/explorer.out", "merge_logs" : false, "watch" : false, "max_restarts" : 100, diff --git a/roles/validator/defaults/main.yml b/roles/validator/defaults/main.yml index 37fd20d..5740899 100644 --- a/roles/validator/defaults/main.yml +++ b/roles/validator/defaults/main.yml @@ -1,5 +1,7 @@ --- +user: ubuntu + allow_validator_ssh: true allow_validator_p2p: true