radekg / terraform-provisioner-ansible

Ansible with Terraform 0.14.x
Apache License 2.0
572 stars 100 forks source link

Don't always set ANSIBLE_ROLE_PATH #109 #110

Closed killerwhile closed 5 years ago

killerwhile commented 5 years ago

Summary

Addresses issue #109

When neither ANSIBLE_ROLES_PATH nor DEFAULT_ROLES_PATH environment variables are set, ANSIBLE_ROLES_PATH is still set to defaultRolesPath. This avoid usage of ansible.cfg file, since ANSIBLE_ROLES_PATH has precedence over ansible.cfg:role_path attribute.

This PR is to avoid forcing ANSIBLE_ROLES_PATH when no path is provided, deferring to the ansible.cfg or ansible defaults when possible.

radekg commented 5 years ago

Hi @killerwhile, thank you for the PR. I would assume it is safe to remove the definition in https://github.com/radekg/terraform-provisioner-ansible/blob/5cc800253fb471b70cc15fce448cf6324d3f299b/types/play.go#L37-L39?

killerwhile commented 5 years ago

Yes, absolutely, forgot this part. I'm updating.

radekg commented 5 years ago

This looks awesome, thank you!