-
Notifications
You must be signed in to change notification settings - Fork 12
/
DistributeKeys.tf
40 lines (32 loc) · 1.04 KB
/
DistributeKeys.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#
# copy the keys over to the controller to allow SSH access to the other nodes
#
resource "null_resource" "controller-distribute-keys" {
connection {
host = equinix_metal_device.controller.access_public_ipv4
private_key = local_file.cluster_private_key_pem.content
}
provisioner "file" {
source = local_file.cluster_private_key_pem.filename
destination = "openstack_rsa"
}
provisioner "file" {
source = local_file.cluster_public_key.filename
destination = "openstack_rsa.pub"
}
}
# keep a set on the dashboard as a backup in case the controller is down
resource "null_resource" "dashboard-distribute-keys" {
connection {
host = equinix_metal_device.dashboard.access_public_ipv4
private_key = local_file.cluster_private_key_pem.content
}
provisioner "file" {
source = local_file.cluster_private_key_pem.filename
destination = "openstack_rsa"
}
provisioner "file" {
source = local_file.cluster_public_key.filename
destination = "openstack_rsa.pub"
}
}