File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 8
8
9
9
.PHONY : tf-apply
10
10
tf-apply :
11
- terraform -chdir=./terraform apply
11
+ terraform -chdir=./terraform apply -var-file=../terraform.tfvars
12
12
13
13
.PHONY : ansible-run
14
14
ansible-run :
Original file line number Diff line number Diff line change @@ -4,6 +4,10 @@ terraform {
4
4
source = " hetznercloud/hcloud"
5
5
version = " 1.32.2"
6
6
}
7
+ github = {
8
+ source = " integrations/github"
9
+ version = " ~> 4.0"
10
+ }
7
11
}
8
12
}
9
13
@@ -13,10 +17,21 @@ variable "hcloud_token" {
13
17
sensitive = true
14
18
}
15
19
20
+ variable "github_user" {
21
+ type = string
22
+ description = " The Github user account which first SSH key is used"
23
+ }
24
+
16
25
provider "hcloud" {
17
26
token = var. hcloud_token
18
27
}
19
28
29
+ provider "github" {}
30
+
31
+ data "github_user" "my_user" {
32
+ username = var. github_user
33
+ }
34
+
20
35
resource "hcloud_network" "kubernetes_network" {
21
36
ip_range = " 10.0.0.0/16"
22
37
name = " network-kubernetes"
@@ -36,7 +51,7 @@ resource "hcloud_placement_group" "group_spread" {
36
51
37
52
resource "hcloud_ssh_key" "ssh_key_zolli" {
38
53
name = " key_zolli"
39
- public_key = " ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDEx60XjFcsAk1n2C8+1RtQ/J3p+eJWlCIBCsI8LMnVoWcLdf7MgSqteAPuvUoUC5MW6AaumlDiVj0Grl5NYrgC7nm2g9dbKZJURtNtAngWqSJoDOxXLvwyuNsat2JMKnpeLPpeZVNT5EhbKnaBJ+uOZLm/ZBhx9OwTovEudKfidYt1oAd+u6rTZ5CgUP3jwJLTSYDxy4NT9W9wZMxBcR6ev90k9crs4fL4ZTReGtW/EFLoJ/X8cRX0j5A4GV4aKy/lBWgUnqMgNZJZZLGB2FnkumzjqE+c20jr6BRij82opI3/1DcQO0dzlkaSDCUcZK/kS46hfyCtJpgCBmpVohSRarTZJJUvLqjXuj7O6VJOV5FYqTDqmuJkPNHUZWzikZxn51xyYAhzcU9PnEXdaWgNaoZiyYiYyOGuyDuwSnp8/rYwSnDwGS0Y4NS63xO04rEOUNpdMbqu0EJseISAH0bz8aWka7+kBopbG58FU3SyNfxYGqIx27nuCLgvRbsH/IZDF/WmrODZJMXaK5haQeX/N28SPTTt35VFCSjGnQBMPCplH417KQVrp2SWeQgpVfo2grrRykpx9RnhKO0HgP7hdJR2TqrZ1wiGDp6kUIYqr6xXdZOm1KVGN+21eu5dNw6ndFp0DoyskXHnu7qX0dlVlHf6PbdO4wzHnHD/psTBsQ== [email protected] "
54
+ public_key = data . github_user . my_user . ssh_keys . 0
40
55
}
41
56
42
57
resource "hcloud_firewall" "firewall_kubernetes" {
You can’t perform that action at this time.
0 commit comments