Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection isn't configured for provisioners to use inside of azurerm_virtual_machine #7122

Closed
colemickens opened this issue Jun 11, 2016 · 7 comments

Comments

@colemickens
Copy link

Terraform v0.7.0-rc1 (301da85f30239e87b30db254a25706a6d41c2522)

  • azurerm_virtual_machine
  • remote_exec

Expected Behavior

It would use the information given during configuration to SetConnInfo so that provisioners can connect automatically.

Actual Behavior

This isn't implemented and so it can't connect and just fails in an infinite loop.

azurerm_virtual_machine.master_vm (remote-exec): Connecting to remote host via SSH...
azurerm_virtual_machine.master_vm (remote-exec):   Host:
azurerm_virtual_machine.master_vm (remote-exec):   User: root
azurerm_virtual_machine.master_vm (remote-exec):   Password: false
azurerm_virtual_machine.master_vm (remote-exec):   Private key: false
azurerm_virtual_machine.master_vm (remote-exec):   SSH Agent: false
@stack72
Copy link
Contributor

stack72 commented Jun 11, 2016

Hi @colemickens

I'm not quite following what the issue is here?

When you give a virtual_machine a username and a password and a static ip then you can connect to it with a remote-exec for provisioning

Is there something different you need?

P.

@colemickens
Copy link
Author

I was thinking that this, in the google provider lets the file provisioner work without having to manually specify the connection details: https://github.com/hashicorp/terraform/blob/master/builtin/providers/google/resource_compute_instance.go#L719

And I was hoping something similar could be done in the Read function for the azurerm_virtual_machine.

stack72 added a commit that referenced this issue Jun 23, 2016
succeeded

This fixes #7122 where the SG was not fully configured before a
dependant service was created

```
make testacc TEST=./builtin/providers/azurerm
TESTARGS='-run=TestAccAzureRMNetworkSecurityGroup_'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMNetworkSecurityGroup_ -timeout 120m
=== RUN   TestAccAzureRMNetworkSecurityGroup_basic
--- PASS: TestAccAzureRMNetworkSecurityGroup_basic (128.93s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_withTags
--- PASS: TestAccAzureRMNetworkSecurityGroup_withTags (164.52s)
=== RUN   TestAccAzureRMNetworkSecurityGroup_addingExtraRules
--- PASS: TestAccAzureRMNetworkSecurityGroup_addingExtraRules (178.20s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
471.677s
```
@colemickens
Copy link
Author

Hi @jen20. Is it possible the wrong issue got closed? The NSG/polling issue was #7153 rather than this one.

@stack72 stack72 reopened this Jun 24, 2016
@stack72
Copy link
Contributor

stack72 commented Jun 24, 2016

sorry, my fault! I had the wrong issue in my PR

@josephholsten
Copy link
Contributor

josephholsten commented Feb 20, 2017

@stack72 is this a thing we should solve with better documentation? seems like the current approach is to

  provisioner "remote-exec" {
    inline = [
      "/tmp/init.sh",
    ]
    connection {
      host = "${azurerm_public_ip.node.ip_address}"
    }
  }

Does that seem correct?

@josephholsten
Copy link
Contributor

well, if #6634 is still an issue then my approach won't work

@ghost
Copy link

ghost commented Apr 10, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants