ansible / terraform-provider-ansible

community terraform provider for ansible
https://registry.terraform.io/providers/ansible/ansible/latest
GNU General Public License v3.0
195 stars 43 forks source link

Empty Summary - Poor error handling #101

Open Fleurpot82 opened 6 months ago

Fleurpot82 commented 6 months ago

I am trying to use the ansible provider to run a play book, the plan works and its only when going to apply I see an error, however even with terraform in debug the only information provided is:

ansible_playbook.simpleplaybook: Creating... ╷ │ Error: Empty Summary: This is always a bug in the provider and should be reported to the provider developers. │ │ with ansible_playbook.simpleplaybook, │ on main.tf line 34, in resource "ansible_playbook" "simpleplaybook": │ 34: resource "ansible_playbook" "simpleplaybook" { │ │ ansible-playbook ╵ Operation failed: failed running terraform apply (exit 1)

gravesm commented 5 months ago

@Fleurpot82 Can you provide a terraform config to reproduce this error?

dampersand commented 1 day ago

I can replicate this error with the following config, running in a container:

terraform {
  required_version = "~> 1.8.2"
  required_providers {
    ansible = {
      source = "ansible/ansible"
      version = "1.3.0"
    }
  }
}

resource "ansible_vault" "secrets" {
  vault_file          = "/terraform/vault"
  vault_password_file = "/user/.ansible-vault/password"
}

Installing ansible on the container fixed my issue... make sure ansible is installed in your execution environment.