-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.envrc
45 lines (35 loc) · 2.4 KB
/
.envrc
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
# log in to 1Password
eval $(op signin)
# create read/write at https://console.hetzner.cloud/projects/PROJECTID/security/tokens
export HCLOUD_TOKEN="$(op read op://Homecluster/ENV_HCLOUD_TOKEN/password)"
# the instructions use `home-cluster`
export HCLOUD_CONTEXT="$(op read op://Homecluster/ENV_HCLOUD_CONTEXT/password)"
# paste the content from `~/.ssh/id_rsa.pub` here (in double quotes, without `user@server` at the end)
export SSH_PUBLIC_KEY="$(op read op://Homecluster/ENV_SSH_PUBLIC_KEY/password)"
# most likely `root` since other ones have not been tested
export SSH_USER="$(op read op://Homecluster/ENV_SSH_USER/username)"
# get it with `hcloud server ip server-1`
export SERVER_1_IP="$(op read op://Homecluster/ENV_SERVER_1_IP/password)"
export SERVER_2_IP="$(op read op://Homecluster/ENV_SERVER_2_IP/password)"
export SERVER_3_IP="$(op read op://Homecluster/ENV_SERVER_3_IP/password)"
export CLIENT_1_IP="$(op read op://Homecluster/ENV_CLIENT_1_IP/password)"
export CLIENT_2_IP="$(op read op://Homecluster/ENV_CLIENT_2_IP/password)"
# get it from the private network created, e.g. 10.0.0.2 from `hcloud server describe server-1 | grep IP`
export SERVER_1_IP_INTERNAL="$(op read op://Homecluster/ENV_SERVER_1_IP/ip_internal)"
export SERVER_2_IP_INTERNAL="$(op read op://Homecluster/ENV_SERVER_2_IP/ip_internal)"
export SERVER_3_IP_INTERNAL="$(op read op://Homecluster/ENV_SERVER_3_IP/ip_internal)"
export CLIENT_1_IP_INTERNAL="$(op read op://Homecluster/ENV_CLIENT_1_IP/ip_internal)"
export CLIENT_2_IP_INTERNAL="$(op read op://Homecluster/ENV_CLIENT_2_IP/ip_internal)"
# get it at https://my.zerotier.com`
export ZT_SERVER_1_IP="$(op read op://Homecluster/ENV_SERVER_1_IP/ip_zerotier)"
export ZT_SERVER_2_IP="$(op read op://Homecluster/ENV_SERVER_2_IP/ip_zerotier)"
export ZT_SERVER_3_IP="$(op read op://Homecluster/ENV_SERVER_3_IP/ip_zerotier)"
export ZT_CLIENT_1_IP="$(op read op://Homecluster/ENV_CLIENT_1_IP/ip_zerotier)"
export ZT_CLIENT_2_IP="$(op read op://Homecluster/ENV_CLIENT_2_IP/ip_zerotier)"
export VAULT_ADDR=http://$ZT_SERVER_1_IP:8200
export CONSUL_HTTP_ADDR=http://$ZT_SERVER_1_IP:8500
export NOMAD_ADDR=http://$ZT_SERVER_1_IP:4646
# the domain name to use for your cluster
export NOMAD_VAR_domain="$(op read op://Homecluster/ENV_NOMAD_VAR_domain/password)"
# the root token for your vault cluster. Careful: grants access to the data in vault
export VAULT_TOKEN="$(op read op://Homecluster/ENV_VAULT_TOKEN/password)"