Skip to content
This repository has been archived by the owner on Oct 3, 2019. It is now read-only.

Argument or block definition required terraform #121

Closed
ashwini9860 opened this issue Jul 24, 2019 · 1 comment
Closed

Argument or block definition required terraform #121

ashwini9860 opened this issue Jul 24, 2019 · 1 comment

Comments

@ashwini9860
Copy link

I am new to terraform not able to solve this error

Error
Argument or block definition required
on main.tf line 77, in resource "null_resource" "default_provisioner":
An argument or block definition is required here

My code

resource "null_resource" "default_provisioner" {

triggers {

default_instance_id = "${aws_instance.testInstance.id}"

}

connection {

host = "${aws_instance.testInstance.public_ip}"

type = "ssh"

user = "terraform"   # as created in 'user_data'

private_key = "${file("/root/.ssh/id_rsa_terraform")}"

}

provisioner "remote-exec" {

inline = [

  "echo 'ready'"

]

}
provisioner "ansible" {

plays {

  playbook = {

    file_path = "./ansible/playbook/main.yml"

    roles_path = [

      "./ansible/roles",
    ]

  }

hosts = ["${aws_instance.testInstance.public_ip}"]

become = true

become_method = "sudo"

become_user = "root"

extra_vars = {
ansible_become_pass = "${file("/etc/ansible/become_pass")}"
}
}
}

@apparentlymart
Copy link
Contributor

Hi @ashwini9860,

This is a Terraform question, so please instead ask it in the Terraform community forum. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants