Giter Club home page Giter Club logo

terraform-provider-ansible's Introduction

Terraform Provider for Ansible

The Terraform Provider for Ansible provides a more straightforward and robust means of executing Ansible automation from Terraform than local-exec. Paired with the inventory plugin in the Ansible cloud.terraform collection, users can run Ansible playbooks and roles on infrastructure provisioned by Terraform. The provider also includes integrated ansible-vault support.

This provider can be found in the Terraform Registry here.

For more details on using Terraform and Ansible together see these blog posts:

Requirements

Installation for Local Development

Run make. This will build a terraform-provider-ansible binary in the top level of the project. To get Terraform to use this binary, configure the development overrides for the provider installation. The easiest way to do this will be to create a config file with the following contents:

provider_installation {
  dev_overrides {
    "ansible/ansible" = "/path/to/project/root"
  }

  direct {}
}

The /path/to/project/root should point to the location where you have cloned this repo, where the terraform-provider-ansible binary will be built. You can then set the TF_CLI_CONFIG_FILE environment variable to point to this config file, and Terraform will use the provider binary you just built.

Testing

Lint:

curl -L https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-amd64.tar.gz \
    | tar --wildcards -xzf - --strip-components 1 "**/golangci-lint"
curl -L https://github.com/nektos/act/releases/download/v0.2.34/act_Linux_x86_64.tar.gz \
    | tar -xzf - act

# linters
./golangci-lint run -v

# tests
make test

# GH actions locally
./act

Examples

The examples subdirectory contains a usage example for this provider.

Releasing

To release a new version of the provider:

  1. Update the version number in https://github.com/ansible/terraform-provider-ansible/blob/main/examples/provider/provider.tf
  2. Run go generate to regenerate docs
  3. Commit changes
  4. Push a new tag (this should trigger an automated release process to the Terraform Registry)
  5. Verify the new version is published at https://registry.terraform.io/providers/ansible/ansible/latest

Licensing

GNU General Public License v3.0. See LICENSE for full text.

terraform-provider-ansible's People

Contributors

anazobec avatar gravesm avatar abikouo avatar polonam avatar fbjerggaard avatar tima avatar alinabuzachis avatar chrisvanmeer avatar zhouweico avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.