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

Unable to access public IP of a newly created GCP instance in local-exec's Ansible #18782

Closed
talonx opened this issue Sep 4, 2018 · 2 comments

Comments

@talonx
Copy link

talonx commented Sep 4, 2018

Terraform Version

Terraform v0.11.8
+ provider.google v1.17.1

Terraform Configuration Files

resource "google_compute_instance" "my-base-instance" {
  project = "${var.project}"
  service_account {
    scopes = [
      "https://www.googleapis.com/auth/bigtable.data",
      "https://www.googleapis.com/auth/bigtable.admin.table",
      "https://www.googleapis.com/auth/compute",
      "https://www.googleapis.com/auth/devstorage.read_only",
      "https://www.googleapis.com/auth/logging.write",
      "https://www.googleapis.com/auth/monitoring.write",
      "https://www.googleapis.com/auth/pubsub",
      "https://www.googleapis.com/auth/service.management.readonly",
      "https://www.googleapis.com/auth/servicecontrol",
      "https://www.googleapis.com/auth/trace.append"
    ]
  }

  "boot_disk" {
    initialize_params {
      image = "${var.IMAGE_PROJECT}/${var.IMAGE_FAMILY}"
    }
    auto_delete = true
  }
  machine_type = "n1-standard-1"
  name = "my-base-instance"
  "network_interface" {
    network = "default"
  }

  zone = "${var.ZONE}"
  provisioner "local-exec" {
    command = "cd ../;ansible-playbook -v -i '${self.network_interface.0.access_config.0.assigned_nat_ip},' playbook.yml"
  }
}

Debug Output

Crash Output

Expected Behavior

The Ansible playbook should have run successfully against the newly created instance.

Actual Behavior

* google_compute_instance.my-base-instance: Resource 'google_compute_instance.my-base-instance.0' does not have attribute 'network_interface.0.access_config.0.assigned_nat_ip' for variable 'google_compute_instance.my-base-instance.0.network_interface.0.access_config.0.assigned_nat_ip'

Steps to Reproduce

Additional Context

References

@ghost
Copy link

ghost commented Sep 4, 2018

This issue has been automatically migrated to hashicorp/terraform-provider-google#1982 because it looks like an issue with that provider. If you believe this is not an issue with the provider, please reply to hashicorp/terraform-provider-google#1982.

@ghost
Copy link

ghost commented Apr 2, 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 2, 2020
This issue was closed.
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

2 participants