Skip to content

Commit

Permalink
add my public ssh key
Browse files Browse the repository at this point in the history
  • Loading branch information
bartekpacia committed Oct 17, 2024
1 parent 1ffbdc1 commit d5a8c89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
7 changes: 6 additions & 1 deletion infra-do/droplet-executor.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ resource "digitalocean_droplet" "executor" {
size = "s-1vcpu-2gb" # doctl compute size list
image = "ubuntu-24-04-x64"

ssh_keys = [digitalocean_ssh_key.default.fingerprint]

volume_ids = []

vpc_uuid = digitalocean_vpc.default.id
Expand Down Expand Up @@ -36,11 +38,14 @@ resource "digitalocean_droplet" "executor" {
- echo "DB_NAME=${digitalocean_database_cluster.postgres.name}" >> .executor.env
# Influx config
- echo "INFLUXDB_URL=TODO" >> .executor.env
- echo "INFLUXDB_URL=http://${digitalocean_droplet.influxdb.ipv4_address_private}:8086" >> .executor.env
- echo "INFLUXDB_ORG=${var.influxdb_org}" >> .executor.env
- echo "INFLUXDB_BUCKET=${var.influxdb_bucket}" >> .executor.env
- echo "INFLUXDB_TOKEN=${var.influxdb_token}" >> .executor.env
- docker run --env-file .executor.env bee-ci-backend-executor:latest
EOF
}

# To check if cloud-init completed successfully, see:
# https://www.digitalocean.com/community/questions/how-to-make-sure-that-cloud-init-finished-running
6 changes: 6 additions & 0 deletions infra-do/droplet-influx.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ resource "digitalocean_droplet" "influxdb" {
size = "s-1vcpu-512mb-10gb" # doctl compute size list
image = "ubuntu-24-04-x64"

ssh_keys = [digitalocean_ssh_key.default.fingerprint]

volume_ids = [digitalocean_volume.influxdb_volume.id]

vpc_uuid = digitalocean_vpc.default.id
Expand All @@ -15,6 +17,7 @@ resource "digitalocean_droplet" "influxdb" {
packages:
- curl
# From: https://docs.influxdata.com/influxdb/v2/install/?t=Linux
runcmd:
- curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
- echo "deb https://repos.influxdata.com/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
Expand Down Expand Up @@ -49,3 +52,6 @@ resource "digitalocean_volume" "influxdb_volume" {
region = "sfo3"
initial_filesystem_type = "ext4"
}

# To check if cloud-init completed successfully, see:
# https://www.digitalocean.com/community/questions/how-to-make-sure-that-cloud-init-finished-running
6 changes: 6 additions & 0 deletions infra-do/droplet-vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ resource "digitalocean_vpc" "default" {
region = "sfo3"
ip_range = "10.0.0.0/16"
}

resource "digitalocean_ssh_key" "default" {
name = "main key"
public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILlmPPetLfPL/eTOI5wLcO3sBiY6wtjhwgm/wlQSd2LP"
# "bee-ci droplets key" in 1Password
}
7 changes: 0 additions & 7 deletions infra-do/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,3 @@ output "live_domain" {
output "volume_id" {
value = digitalocean_volume.influxdb_volume.id
}

output "influx_droplet_ip" {
value = digitalocean_droplet.influxdb.private_networking
}
output "droplet_1_private_ip" {
value = digitalocean_droplet.executor.private_networking
}

0 comments on commit d5a8c89

Please sign in to comment.