Skip to main content

tf-glue

Orchestrate OpenTofu (or Terraform) initialization and interactions with Ansible and Incus (including Incus S3 bucket as state backend).

Features

This tool provides some frequently needed glue for projects that combine part of, or all of, the following infrastructure automation stack:

Supported interactions between OpenTofu/Terraform and Incus:

Supported interactions with Ansible:

  • Read Incus client configuration from Ansible inventory's variables defined for the Incus connection plugin.
  • Identify unused IP addresses on Incus networks, reserve them, so that they can be passed as variables to a dynamic Ansible inventory.
  • Generate a dynamic Ansible inventory by compiling a YAML Jinja2 template with variables coming from Incus client and/or OpenTofu.

Installation

This tool can be installed from PyPI:

pip install tf-glue

Add the template extra (i.e. pyyaml and jinja2) to generate dynamic Ansible inventories from templates:

pip install tf-glue[template]

Usage

This tool can be used as a command-line application. The following example initializes OpenTofu (or Terraform) with an Incus-managed S3 bucket named myproject-state as its state backend (the bucket is automatically created if it does not exist yet) and variable definitions related to Incus client configuration:

tf-glue init --bucket myproject-state

See command-line help for available commands and options:

tf-glue --help

This tool can also be used as a Python library. Example:

#!/usr/bin/env python3
from tf_glue.ansible import generate_inventory
from tf_glue.incus import Incus

incus = Incus()  # will use the environment detected by the Incus command-line client
generate_inventory("mytemplate.yml", incus=incus)

Contributing

Pull requests are welcome. See:

This tool is licensed under the MIT license.

It is not affiliated in any way with OpenTofu, Terraform, Ansible, Incus or any associated organization.

Metadata

Release files for tf-glue 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for tf-glue 1.0.0
File Interpreter ABI Platform Actions
tf_glue-1.0.0-py3-none-any.whl Python 3 none any Details for tf_glue-1.0.0-py3-none-any.whl

Release files / tf_glue-1.0.0-py3-none-any.whl

Download URL tf_glue-1.0.0-py3-none-any.whl
Size 24.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa8a2022c2a4f9d8911508ca8e689f497e68bdc6e0b6f2385fb9f921bab3db64
BLAKE2b-256 checksum
How to use checksums
ccb5c9ddf613b238de488d3cbbe8795536948ac414fda55497e8d7acbb7b7ee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for tf-glue 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page