gokrazy: read config from EC2 user-data on the appliance
One AMI now self-configures from user-data or, when absent, enrolls over serial. Updates #1866 Signed-off-by: Kristoffer Dalby <kristoffer@tailscale.com>
This commit is contained in:
committed by
Kristoffer Dalby
parent
758c28fd41
commit
5e0972344a
@@ -74,3 +74,30 @@ $ aws ec2-instance-connect send-serial-console-ssh-public-key --instance-id i-0b
|
||||
}
|
||||
$ ssh i-0b4a0eabc43629f13.port0@serial-console.ec2-instance-connect.us-west-2.aws
|
||||
```
|
||||
|
||||
### Configuring the appliance
|
||||
|
||||
The appliance's `tailscaled` runs with `-config=optional:vm:user-data`, so a
|
||||
single AMI supports two ways of joining a tailnet:
|
||||
|
||||
- **Declarative (user-data):** put a Tailscale config (the `alpha0` HuJSON
|
||||
format) in the instance's user-data and the node configures itself on first
|
||||
boot. The minimal config is just an auth key:
|
||||
|
||||
```json
|
||||
{
|
||||
"Version": "alpha0",
|
||||
"AuthKey": "tskey-auth-..."
|
||||
}
|
||||
```
|
||||
|
||||
A config present in user-data locks the CLI (`tailscale set`/`up` are
|
||||
rejected) unless it sets `"Locked": false`.
|
||||
|
||||
- **Interactive (serial console):** launch the AMI with *no* user-data. The
|
||||
`optional:` prefix means the missing config is not an error, so `tailscaled`
|
||||
boots unconfigured and you can enroll it over the serial console (connect as
|
||||
above, then run `tailscale up` and open the printed login URL).
|
||||
|
||||
To require config instead (fail to boot if none is present), build an image
|
||||
whose `tailscaled` uses `-config=vm:user-data` without the `optional:` prefix.
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
]
|
||||
},
|
||||
"tailscale.com/cmd/tailscaled": {
|
||||
"CommandLineFlags": [
|
||||
"-config=optional:vm:user-data"
|
||||
],
|
||||
"GoBuildTags": [
|
||||
"ts_appliance"
|
||||
]
|
||||
|
||||
@@ -32,6 +32,9 @@
|
||||
]
|
||||
},
|
||||
"tailscale.com/cmd/tailscaled": {
|
||||
"CommandLineFlags": [
|
||||
"-config=optional:vm:user-data"
|
||||
],
|
||||
"GoBuildTags": [
|
||||
"ts_appliance"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user