Commit f46871ff authored by Alex Hanselka's avatar Alex Hanselka
Browse files

feat: automatically add ssh keys

parent cff091c9
......@@ -20,12 +20,19 @@ variable "ansible_token" {
data "google_dns_managed_zone" "darkdna" {
name = "darkdna"
}
data "hcloud_ssh_key" "ansible" {
name = "scaleway-ansible"
}
data "hcloud_ssh_key" "ahanselka" {
name = "ahanselka"
}
# Create a new server running debian
resource "hcloud_server" "generic-hcloud" {
name = "${var.node_name}"
image = "${var.image}"
server_type = "${var.type}"
ssh_keys = ["${data.hcloud_ssh_key.ansible}", "${data.hcloud_ssh_key.ahanselka}"]
provisioner "local-exec" {
command = "curl -X POST -F token=${var.ansible_token} -F ref=master -F 'variables[NEW_HOST]=${var.node_name}' https://gitlab.darkdna.net/api/v4/projects/144/trigger/pipeline"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment