This repository has been archived by the owner on Jun 12, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 nextterraform 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.