Skip to content

Commit b22f5e8

Browse files
committed
terraform: Remove the terrraform update_ssh_config module
Unhook terraform's update_ssh_config module now that kdevops handles this step. Signed-off-by: Chuck Lever <[email protected]>
1 parent 8b2f868 commit b22f5e8

15 files changed

+3
-123
lines changed

terraform/aws/output.tf

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,5 @@
11
# All generic output goes here
22

3-
locals {
4-
ssh_key_i = format(
5-
" %s%s ",
6-
var.ssh_config_pubkey_file != "" ? "-i " : "",
7-
var.ssh_config_pubkey_file != "" ? replace(var.ssh_config_pubkey_file, ".pub", "") : "",
8-
)
9-
}
10-
11-
data "null_data_source" "group_hostnames_and_ips" {
12-
count = local.kdevops_num_boxes
13-
inputs = {
14-
value = format(
15-
"%30s : ssh %s@%s %s ",
16-
element(var.kdevops_nodes, count.index),
17-
var.ssh_config_user,
18-
element(aws_eip.kdevops_eip.*.public_ip, count.index),
19-
local.ssh_key_i,
20-
)
21-
}
22-
}
23-
24-
output "login_using" {
25-
value = data.null_data_source.group_hostnames_and_ips.*.outputs
26-
}
27-
283
# Each provider's output.tf needs to define a public_ip_map. This
294
# map is used to build the Ansible controller's ssh configuration.
305
# Each map entry contains the node's hostname and public IP address.

terraform/aws/update_ssh_config.tf

Lines changed: 0 additions & 1 deletion
This file was deleted.

terraform/aws/update_ssh_config_use.tf

Lines changed: 0 additions & 12 deletions
This file was deleted.

terraform/azure/output.tf

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,6 @@ output "kdevops_public_ip_addresses" {
2020
value = data.azurerm_public_ip.public_ips.*.ip_address
2121
}
2222

23-
locals {
24-
ssh_key_i = format(" %s%s ", var.ssh_config_pubkey_file != "" ? "-i " : "", var.ssh_config_pubkey_file != "" ? replace(var.ssh_config_pubkey_file, ".pub", "") : "")
25-
}
26-
27-
data "null_data_source" "group_hostnames_and_ips" {
28-
count = local.kdevops_num_boxes
29-
inputs = {
30-
# In theory using "${self.triggers["name"]}" and "${self.triggersp["ip"]}"
31-
# would be nice but it is not supported in this context, only in the
32-
# provisioner and connection contexts.
33-
value = "${format("%30s : ssh %s@%s %s ", element(azurerm_linux_virtual_machine.kdevops_vm.*.name, count.index), var.ssh_config_user, element(azurerm_public_ip.kdevops_publicip.*.ip_address, count.index), local.ssh_key_i)}"
34-
}
35-
}
36-
37-
output "login_using" {
38-
value = data.null_data_source.group_hostnames_and_ips.*.outputs
39-
}
40-
4123
# Each provider's output.tf needs to define a public_ip_map. This
4224
# map is used to build the Ansible controller's ssh configuration.
4325
# Each map entry contains the node's hostname and public IP address.

terraform/azure/update_ssh_config.tf

Lines changed: 0 additions & 1 deletion
This file was deleted.

terraform/azure/update_ssh_config_use.tf

Lines changed: 0 additions & 4 deletions
This file was deleted.

terraform/gce/output.tf

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,4 @@
1-
locals {
2-
ssh_key_i = format(" %s%s ", var.ssh_config_pubkey_file != "" ? "-i " : "", var.ssh_config_pubkey_file != "" ? replace(var.ssh_config_pubkey_file, ".pub", "") : "")
3-
network_interfaces = google_compute_instance.kdevops_instances.*.network_interface
4-
access_configs = [
5-
for net_interface in local.network_interfaces :
6-
net_interface[0].access_config
7-
]
8-
ipv4s = [
9-
for access_config in local.access_configs :
10-
access_config[0].nat_ip
11-
]
12-
}
13-
14-
data "null_data_source" "group_hostnames_and_ips" {
15-
count = local.kdevops_num_boxes
16-
inputs = {
17-
# In theory using "${self.triggers["name"]}" and "${self.triggersp["ip"]}"
18-
# would be nice but it is not supported in this context, only in the
19-
# provisioner and connection contexts.
20-
value = "${format("%30s : ssh %s@%s %s ", element(google_compute_instance.kdevops_instances.*.name, count.index), var.ssh_config_user, element(local.ipv4s, count.index), local.ssh_key_i)}"
21-
}
22-
}
23-
24-
output "login_using" {
25-
value = data.null_data_source.group_hostnames_and_ips.*.outputs
26-
}
1+
# All generic output goes here
272

283
# Each provider's output.tf needs to define a public_ip_map. This
294
# map is used to build the Ansible controller's ssh configuration.

terraform/gce/update_ssh_config.tf

Lines changed: 0 additions & 1 deletion
This file was deleted.

terraform/gce/update_ssh_config_use.tf

Lines changed: 0 additions & 4 deletions
This file was deleted.

terraform/oci/update_ssh_config.tf

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)