--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/b44953e0-c326-472f-aa36-2e0271ddb313%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
resource "azurerm_public_ip" "vm" { count = var.nb_public_ip name = "${var.prefix}pip-${format("%02d", count.index + 1)}" location = var.location resource_group_name = azurerm_resource_group.vm.name public_ip_address_allocation = var.public_ip_address_allocation domain_name_label = "${var.vm_hostname}${format("%02d", count.index + 1)}" tags = var.tags}provisioner "remote-exec" { connection { type = "ssh" user = var.admin_username password = var.admin_password }
inline = [ "sudo apt-add-repository ppa:ansible/ansible -y", "sudo apt-get update -y", "sudo apt-get install ansible -y", "sudo apt-get upgrade -y", "sudo apt-get install htop -y", "sudo shutdown -r -t 10", "exit 0", ] }There is no trick here, it just works.
On Wed, May 29, 2019 at 7:50 PM Franco König <franco...@gmail.com> wrote:
hi all--how it is possible to make a remote-exec over ssh to a linux vm in azure with public ip? i try to add azurerm_public_ip.ipaddress but that not works. when i try it with the dns hostname that will work, but is it not possible to add public ip correct in azurerm provider to the connection string on the remote-exec block?regardsfrank
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terrafo...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/97944c45-ff3b-462e-a49e-c4bd842a841e%40googlegroups.com.
data "azurerm_public_ip" "vm" { count = var.nb_instances name = "${element(azurerm_public_ip.vm.*.name, count.index)}" resource_group_name = "${azurerm_resource_group.vm.name}"}
provisioner "remote-exec" { connection { type = "ssh" #host = "${var.vm_hostname}${format("%02d", count.index + 1)}.westeurope.cloudapp.azure.com" host = "${element(data.azurerm_public_ip.vm.*.ip_address, count.index)}" user = var.admin_username password = var.admin_password }
azurerm_virtual_machine.vm-linux[0]: Still creating... [7m30s elapsed]Error: timeout - last error: dial tcp :22: connectex: No connection could be made because the target machine actively refused it.