Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- variable "hcloud_token" {
- }
- provider "hcloud" {
- token = "${var.hcloud_token}"
- }
- resource "hcloud_server" "kube-master" {
- name = "kube-master"
- image = "ubuntu-18.04"
- server_type = "cx11"
- ssh_keys = ["${hcloud_ssh_key.default.id}"]
- connection {
- type = "ssh"
- user = "root"
- private_key = "${file("~/.ssh/id_rsa")}"
- }
- provisioner "file" {
- source = "install-k8s.sh"
- destination = "/opt/install-k8s.sh"
- }
- provisioner "remote-exec" {
- inline = [
- "chmod +x /opt/install-k8s.sh",
- "/opt/install-k8s.sh",
- ]
- }
- }
- resource "hcloud_ssh_key" "default" {
- name = "pubkey"
- public_key = "${file("~/.ssh/id_rsa.pub")}"
- }
- output "ip" {
- value = "${hcloud_server.kube-master.ipv4_address}"
- }
Add Comment
Please, Sign In to add comment