-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8189742
commit 434cca3
Showing
7 changed files
with
6,453 additions
and
468 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
terraform/hcloud/extra-manifests/argocd/get-install.sh
100644 → 100755
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
wget https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml | ||
#!/bin/bash | ||
|
||
curl -X GET https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml --output install.yaml |
6,784 changes: 6,360 additions & 424 deletions
6,784
terraform/hcloud/extra-manifests/argocd/install.yaml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
data "hcloud_servers" "agents" { | ||
with_selector = "role=agent_node" | ||
} | ||
|
||
resource "hcloud_floating_ip" "agent_ip" { | ||
type = "ipv4" | ||
server_id = data.hcloud_servers.agents.servers[0].id | ||
} | ||
|
||
resource "random_string" "identity_file" { | ||
length = 20 | ||
lower = true | ||
special = false | ||
numeric = true | ||
upper = false | ||
} | ||
|
||
resource "null_resource" "agent_floating_ip" { | ||
for_each = { for i, v in data.hcloud_servers.agents.servers: v.name => v } | ||
|
||
triggers = { | ||
agent_id = each.key | ||
} | ||
|
||
connection { | ||
user = "root" | ||
private_key = var.ssh_private_key | ||
agent_identity = var.ssh_public_key | ||
host = each.value.ipv4_address | ||
port = var.ssh_port | ||
} | ||
|
||
provisioner "remote-exec" { | ||
inline = [ | ||
"echo \"Adding ${hcloud_floating_ip.agent_ip.ip_address}\"", | ||
"ip addr add ${hcloud_floating_ip.agent_ip.ip_address} dev eth0", | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
variable "ssh_port" { | ||
description = "The main SSH port to connect to the nodes." | ||
type = number | ||
default = 22 | ||
|
||
validation { | ||
condition = var.ssh_port >= 0 && var.ssh_port <= 65535 | ||
error_message = "The SSH port must use a valid range from 0 to 65535." | ||
} | ||
} | ||
|
||
variable "ssh_public_key" { | ||
description = "SSH public Key." | ||
type = string | ||
} | ||
|
||
variable "ssh_private_key" { | ||
description = "SSH private Key." | ||
type = string | ||
sensitive = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
terraform { | ||
required_version = ">= 1.3.3" | ||
required_providers { | ||
hcloud = { | ||
source = "hetznercloud/hcloud" | ||
version = ">= 1.35.2" | ||
} | ||
} | ||
} |