commit f58812e1529eefccc8e4fb8c36f8d191799b3659
parent c7956cbbf2c071c6c21f645a0a7c6ce91494c99c
Author: Andreas Gruhler <andreas.gruhler@adfinis.com>
Date: Sat, 8 Jun 2024 17:27:54 +0200
feat: upgrade hosts
Diffstat:
4 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -1 +1,2 @@
**.swp
+**.pkrvars.hcl
diff --git a/README.md b/README.md
@@ -13,10 +13,10 @@ Example architecture with 5 RaspberyPi nodes:
| Node | RAM | Nomad function | Consul function |
|------|-----|----------------|-----------------|
-| 00 | 1GB | server | client/server |
-| 01 | 1GB | client | client |
+| 00 | 4GB | client/server | client/server |
+| 01 | 4GB | client | client |
| 02 | 4GB | client/server | client/server |
-| 03 | 1GB | client | client |
+| 03 | 4GB | client | client |
| 04 | 4GB | client/server | client/server |
For best performance on low power devices, the [`raft_multiplier`](https://developer.hashicorp.com/consul/docs/install/performance) is set to the default value 5 (or higher):
@@ -151,11 +151,14 @@ interpreter /usr/bin/qemu-aarch64-static
...
```
-Don't forget to create a new set of [Consul TLS certificates](#Consul) before each run. Run packer with a value file to build an image for one host:
+Don't forget to create a new set of [Consul TLS certificates](#Consul) before
+each run. Run packer with a value file to build an image for one host:
```bash
-./consul-tls.sh && sudo packer build -var-file=hosts/pi0.json hashi-pi.pkr.hcl
+./consul-tls.sh && sudo /usr/bin/packer build -var-file=variables.auto.pkrvars.hcl -var-file=hosts/pi0.json hashi-pi.pkr.hcl
```
+The `variable.auto.pkrvars.hcl` contains all sensitive packer variables.
+
## Write Image to SD Card
To [write the resulting image file to the sd card](https://www.raspberrypi.org/documentation/installation/installing-images/linux.md) with `dd`:
diff --git a/hashi-pi.pkr.hcl b/hashi-pi.pkr.hcl
@@ -100,8 +100,9 @@ variable "nomad_server" {
}
variable "nomad_vault_token" {
- type = string
- default = ""
+ type = string
+ default = ""
+ sensitive = true
}
variable "nomad_version" {
diff --git a/hosts/pi0.json b/hosts/pi0.json
@@ -3,5 +3,5 @@
"img_name": "HashiPi-pi0.img",
"consul_server": "true",
"nomad_server": "true",
- "nomad_client": "false"
+ "nomad_client": "true"
}