terraform-provider-ansible

command module
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 5 Imported by: 0

README

Terraform Provider Ansible

Registry

Run Ansible playbooks within Ansible execution environments (EE) using Terraform.

Features

  1. Run Ansible playbooks against Terraform managed infrastructure (without the local-exec provisioner). Eliminates the need for additional scripting or pipeline steps.
  2. Construct Ansible inventories using other data sources and resources. Set Ansible host and group variables to values and secrets from other providers.
  3. Utilize Ansible execution environments (containers images) to customize and run the Ansible software stack. Isolate Ansible and its related dependencies (Python/System packages, collections, etc) to simplify pipeline and workstation setup.
  4. Write JSONPath queries against playbook artifacts. Extract values from the playbook run for use elsewhere in the configuration. Examples include: Ansible facts, remote file contents, task results -- the possibilities are endless!
  5. Control playbook re-run behavior using several "lifecycle" options, including a flag for running the playbook on resource destruction. Implement conditional plays/tasks with the environment variable ANSIBLE_TF_OPERATION.

Complete Examples

Support Matrix

[!WARNING] Windows builds of this provider are unlikely to work. Bug reports and PRs are welcome.

[!WARNING] All versions released prior to v1.0.0 are to be considered breaking changes.

Release Ansible Navigator Terraform
< v1.0.0 >= 3.5.0 >= 1.5.0

Development Requirements

Building The Provider

  1. Clone the repository
  2. Enter the repository directory
  3. Build the provider using the Go install command:
go install

Adding Dependencies

This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.

To add a new dependency github.com/author/dependency to your Terraform provider:

go get github.com/author/dependency
go mod tidy

Then commit the changes to go.mod and go.sum.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).

To compile the provider, run go install. This will build the provider and put the provider binary in the $GOPATH/bin directory.

To generate or update documentation, run make docs.

In order to run the full suite of Acceptance tests, run make test/acc.

Note: Acceptance tests create real resources, and often cost money to run.

make test/acc

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL