ansible / terraform-provider-ansible

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

Provider plugin fails when ansible not installed #35

Closed stevestrutt closed 3 months ago

stevestrutt commented 1 year ago

Terraform provider plugin fails and does not return messages when ansible-playbook is not found in local path (not installed)

exec: "ansible-playbook": executable file not found in $PATH

image

gravesm commented 1 year ago

@stevestrutt this provider does not install ansible for you. You will have to make sure it is installed. You can also set the location of path using https://registry.terraform.io/providers/ansible/ansible/latest/docs/resources/playbook#ansible_playbook_binary.

stevestrutt commented 1 year ago

@gravesm Agreed Ansible needs to be installed first. The issue is that the error reported to the user if it is not installed is an obscure plugin failure message.

I think this is more of a generic issue for the provider that a failure did not return the cmd exec messages to indicate the cause of the problem. Debugging the issue required that the user is a knowledgeable provider developer and knows to set the TF_PROVIDER_LOG to get the messages to determine the issue.

techieforfun commented 1 month ago

Is there an option to embed the ansible binaries within the provider? When using this provider with Terraform Cloud workers, installing Ansible is not possible due to the lack of root access on the runner.