All Projects → nbering → Terraform Provider Ansible

nbering / Terraform Provider Ansible

Licence: mpl-2.0
"Logical" provider for integrating with an Ansible Dynamic Inventory script.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Terraform Provider Ansible

Terraform Provider Datadog
Terraform Datadog provider
Stars: ✭ 213 (-18.7%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Kafka
Terraform provider for managing Apache Kafka Topics + ACLs
Stars: ✭ 256 (-2.29%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Openstack
Terraform OpenStack provider
Stars: ✭ 225 (-14.12%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Azurerm
Terraform provider for Azure Resource Manager
Stars: ✭ 3,007 (+1047.71%)
Mutual labels:  terraform, terraform-provider
terraform-provider-nutanix
Terraform Nutanix Provider
Stars: ✭ 53 (-79.77%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Ibm
Terraform on IBM provider https://cloud.ibm.com/docs/ibm-cloud-provider-for-terraform?topic=ibm-cloud-provider-for-terraform-getting-started
Stars: ✭ 210 (-19.85%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Virtualbox
VirtualBox provider for Terraform
Stars: ✭ 239 (-8.78%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Sentry
Terraform provider for Sentry
Stars: ✭ 183 (-30.15%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Auth0
Auth0 Terraform Provider
Stars: ✭ 252 (-3.82%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Vault
Terraform Vault provider
Stars: ✭ 244 (-6.87%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Gitlab
Terraform GitLab provider
Stars: ✭ 205 (-21.76%)
Mutual labels:  terraform, terraform-provider
terraform-provider-bigip
Terraform resources that can configure F5 BIG-IP products
Stars: ✭ 74 (-71.76%)
Mutual labels:  terraform, terraform-provider
Terraform Plugin Sdk
Terraform Plugin SDK enables building plugins (providers) to manage any service providers or custom in-house solutions
Stars: ✭ 201 (-23.28%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Cloudflare
Cloudflare Terraform Provider
Stars: ✭ 208 (-20.61%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Hcloud
Terraform provider for Hetzner Cloud
Stars: ✭ 138 (-47.33%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Keycloak
Terraform provider for Keycloak
Stars: ✭ 230 (-12.21%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Kubectl
Terraform provider to handle raw kubernetes manifest yaml files
Stars: ✭ 174 (-33.59%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Azuread
Terraform provider for Azure Active Directory
Stars: ✭ 178 (-32.06%)
Mutual labels:  terraform, terraform-provider
Terraform Provider Unifi
Terraform provider for Unifi 📡
Stars: ✭ 239 (-8.78%)
Mutual labels:  terraform, terraform-provider
terraform-provider-vercel
Terraform Provider for Vercel (former ZEIT)
Stars: ✭ 36 (-86.26%)
Mutual labels:  terraform, terraform-provider

Ansible Terraform Provider

A Terraform provider serving as an interop layer for an Ansible dynamic inventory script.

Read the introductory blog post for an explanation of the design motivations behind this provider.

Installation

Installation can be accomplished in two different ways:

  1. Installing a pre-compiled release (recommended)
  2. Compiling from source

Installing a Pre-Compiled Release

Downloading and installing a pre-compiled terraform-provider-ansible release is the recommended method of installation since it requires no additional tools or libraries to be installed on your workstation.

  1. Visit the releases page and download the latest release for your target architecture.

  2. Unzip the downloaded file and copy the terraform-provider-ansible binary to a designated directory as described in Terraform's plugin installation instructions.

Compiling From Source

Note: Terraform requires Go 1.11 or later to successfully compile.

Note: Dependencies are no longer included in this repository. You may need the bazaar version control utility to download some of Terraform's Go-lang module dependencies.

If you'd like to take advantage of features not yet available in a pre-compiled release, you can compile terraform-provider-ansible from source.

In order to compile, you will need to have Go installed on your workstation. Official instructions on how to install Go can be found here.

Alternatively, you can use gimme as a quick and easy way to install Go:

$ sudo wget -O /usr/local/bin/gimme https://raw.githubusercontent.com/travis-ci/gimme/master/gimme
$ sudo chmod +x /usr/local/bin/gimme
$ gimme 1.10
# copy the output to your `.bashrc` and source `.bashrc`.

Once you have a working Go installation, you can compile terraform-provider-ansible by doing the following:

$ go get github.com/nbering/terraform-provider-ansible
$ cd $GOPATH/src/github.com/nbering/terraform-provider-ansible
$ make

You should now have a terraform-provider-ansible binary located at $GOPATH/bin/terraform-provider-ansible. Copy this binary to a designated directory as described in Terraform's plugin installation instructions

Terraform Configuration Example

resource "ansible_host" "example" {
    inventory_hostname = "example.com"
    groups = ["web"]
    vars = {
        ansible_user = "admin"
    }
}

resource "ansible_group" "web" {
  inventory_group_name = "web"
  children = ["foo", "bar", "baz"]
  vars = {
    foo = "bar"
    bar = 2
  }
}

Compatibility

Version 1.0.0 of this project is compatible with Terraform version 0.12-beta2. You will also need 2.0.0+ of the terraform-inventory script, as the internal structure of Terraform state files has changed.

If you need a version compatible with an earlier version of Terraform, use version 0.0.4.

When upgrading to Terraform 0.12.x, you may need to change your configuration files to reflect changes to the new version of the Hashicorp Configuration Lanaguage (HCL). The only known incompatibility is that vars attributes now require an equals operator (=).

0.11.x

resource "ansible_host" "example" {
    inventory_hostname = "example.com"
    vars {
        ansible_user = "admin"
    }
}

0.12.x

resource "ansible_host" "example" {
    inventory_hostname = "example.com"
    vars = {
        ansible_user = "admin"
    }
}

Alternatives and Similar Projects

jonmorehouse/terraform-provisioner-ansible

A Terraform Provisioner that runs Ansible-Local on a target machine at creation-time.

adammck/terraform-inventory

A very similar solution to this one, without the Logical provider. Depends on specific Terraform resource types, and relies heavily on cloud-providers' tag implementations.

Ansible Module: Terraform

An Ansible module that runs Terraform plans and deployments.

License

Contributions specific to this project are made available under the Mozilla Public License.

Code under the vendor/ directory is copyright of the various package owners, and made available under their own license considerations.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].