Skip to content
This repository has been archived by the owner on Jun 12, 2021. It is now read-only.

add null_resource support #122

Merged
merged 1 commit into from
May 5, 2019
Merged

add null_resource support #122

merged 1 commit into from
May 5, 2019

Conversation

stevestrutt
Copy link
Contributor

Summary

Added support to allow terraform-provisioner-ansible to be used in local_mode with a null_resource. Target hosts for the provisioner can be specified using plays.hosts and interpolation from the ip_address of provisioned compute instances, or by passing an inventory file.

Included updates to Readme and an additional example.

Using terraform taint null_resource.xxxxxxx the provisioner can be triggered to run again on the next terraform apply.

Extensively tested on IBM Cloud. Operation will be the same across all cloud vendors.

Additional comment:
I found when the provisioner is used with a compute resource, it is not necessary to specify a host in the connection block or with plays.hosts. If connection.host is not specified, Terraform passes the public IP address of the instance just created. This usage was not clear in the Readme.

@radekg
Copy link
Owner

radekg commented May 4, 2019

Hi @stevestrutt. Thank you for the pull request. It looks complete. Being able to run Ansible via null_resource effectively turns Terraform into an Ansible runner.

I will run a couple of checks before merging.

@radekg radekg changed the base branch from master to accept_stevestrutt-null_rsource May 5, 2019 20:59
@radekg radekg merged commit ba15c5d into radekg:accept_stevestrutt-null_rsource May 5, 2019
@radekg
Copy link
Owner

radekg commented May 5, 2019

Hi Steve, thank you once again for the contribution. I have merged your PR onto an intermediate branch to have the tests status covered. The intermediate PR is now merged to master. I will create a release mid next week, your changes will be in the new version.

Happy to hear this is extensively tested on the IBM Cloud!

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

Successfully merging this pull request may close these issues.

2 participants