Skip to content
This repository has been archived by the owner on Dec 5, 2020. It is now read-only.

Return more useful error information when the chef role exist in chef server #21

Open
ghost opened this issue Jun 1, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 1, 2018

This issue was originally opened by @binlialfie as hashicorp/terraform#18163. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

Terraform v0.11.7

Terraform Configuration Files

resource "chef_role" "HLN-testing-tf" {
 
  name     = "${var.proj_CompName}-${var.env}-tf"
  description = "${var.proj_CompName}-core role for terraform/AMI instances."
  run_list = [
    "recipe[aaa::bbb]" 
  ]

  override_attributes_json = <<EOF
      {
      }
EOF
}

Debug Output

terraform plan
terraform apply

Error: Error applying plan:

1 error(s) occurred:

  • chef_role.HLN-testing-tf: 1 error(s) occurred:

  • chef_role.HLN-testing-tf: POST https://chef_url/organizations/xxx/roles: 409

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error

Actual Behavior

spend a lot of time trying to debug json syntax error, but it actually fail because the role already exist in chef server.

is there any more chance to report role exist error than just throw 409?

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

1 participant