Added Packer configuration for DigitalOcean
This commit is contained in:
parent
a89c9d9708
commit
c61dc1bd53
7
packer/digitalocean/seed/user-data
Normal file
7
packer/digitalocean/seed/user-data
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
#cloud-config
|
||||||
|
|
||||||
|
ssh_pwauth: false
|
||||||
|
disable_root: false
|
||||||
|
|
||||||
|
runcmd:
|
||||||
|
- sed -i '/ssh_pwauth/d' /etc/cloud/cloud.cfg.d/*-digitalocean.cfg
|
@ -18,6 +18,26 @@ source "hcloud" "main" {
|
|||||||
ssh_timeout = "10m"
|
ssh_timeout = "10m"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
source "digitalocean" "main" {
|
||||||
|
api_token = var.digitalocean_api_token
|
||||||
|
|
||||||
|
image = "ubuntu-20-04-x64"
|
||||||
|
droplet_name = "wireguard-{{timestamp}}"
|
||||||
|
size = "s-1vcpu-1gb"
|
||||||
|
region = "fra1"
|
||||||
|
|
||||||
|
snapshot_name = "wireguard-{{timestamp}}"
|
||||||
|
tags = [
|
||||||
|
"wireguard"
|
||||||
|
]
|
||||||
|
|
||||||
|
user_data_file = "./digitalocean/seed/user-data"
|
||||||
|
|
||||||
|
ssh_port = "22"
|
||||||
|
ssh_username = "root"
|
||||||
|
ssh_timeout = "10m"
|
||||||
|
}
|
||||||
|
|
||||||
source "qemu" "main" {
|
source "qemu" "main" {
|
||||||
iso_url = "https://cloud-images.ubuntu.com/daily/server/focal/current/focal-server-cloudimg-amd64.img"
|
iso_url = "https://cloud-images.ubuntu.com/daily/server/focal/current/focal-server-cloudimg-amd64.img"
|
||||||
iso_checksum = "file:https://cloud-images.ubuntu.com/daily/server/focal/current/SHA256SUMS"
|
iso_checksum = "file:https://cloud-images.ubuntu.com/daily/server/focal/current/SHA256SUMS"
|
||||||
|
@ -3,3 +3,9 @@ variable "hcloud_api_token" {
|
|||||||
description = "Hetzner Cloud API token"
|
description = "Hetzner Cloud API token"
|
||||||
default = ""
|
default = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "digitalocean_api_token" {
|
||||||
|
type = string
|
||||||
|
description = "DigitalOcean API token"
|
||||||
|
default = ""
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user