Skip to main content

Ansible Env Vars

Nox pypi

Extracts variables from the local environment and converts them to Ansible variables.

Install and Setup

Install: uv add [--dev] ans-env-loader

Then place an ans-env-vars.yaml and an env-loader.py into your Ansible playbooks root directory as follows:

 ❯ tree
├── ansible.cfg
├── ans-env-vars.yaml
├── hosts.ini
├── playbook.yaml
└── vars_plugins
    ├── env-loader.py


 ❯ cat vars_plugins/env-loader.py
from ans_env_loader import VarsModule as VarsModule


 ❯ cat ans-env-vars.yaml
# Ansible var name is the same as the expected env var
- app_smtp_host
# Map Ansible var name to a different expected env var
- app_flask_secret: FLASK_SECRET

Dev

Copier Template

Project structure and tooling mostly derives from the Coppy, see its documentation for context and additional instructions.

This project can be updated from the upstream repo, see Updating a Project.

Project Setup

From zero to hero (passing tests that is):

  1. Ensure host dependencies are installed

  2. Start docker service dependencies (if applicable):

    docker compose up -d

  3. Sync project virtualenv w/ lock file:

    uv sync

  4. Configure pre-commit:

    pre-commit install

  5. Run tests:

    nox

Versions

Versions are date based. A bump action exists to help manage versions:

  # Show current version
  mise bump --show

  # Bump version based on date, tag, and push:
  mise bump

  # See other options
  mise bump -- --help

Metadata

Release files for ans-env-loader 0.20250728.1

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

Source distribution (sdist)

Source distribution for ans-env-loader 0.20250728.1
File Size Uploaded
ans_env_loader-0.20250728.1.tar.gz 44.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ans-env-loader 0.20250728.1
File Interpreter ABI Platform
ans_env_loader-0.20250728.1-py3-none-any.whl Python 3 none any Details

Total release size: 47.0 kB

Release files / ans_env_loader-0.20250728.1.tar.gz

Download URL ans_env_loader-0.20250728.1.tar.gz
Size 44.1 kB
Tags Source
SHA-256 checksum
How to use checksums
88238eed70787568cb1030037f67f63f60a685c7fb60d28263bd6429dee0d29d
BLAKE2b-256 checksum
How to use checksums
b73fd1d8d9edc93de99259bcedb2d15abd985cfc68416f7360c12603aafc82f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2025.

Transparency log

Release files / ans_env_loader-0.20250728.1-py3-none-any.whl

Download URL ans_env_loader-0.20250728.1-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01524f93f306b45083ed6788871a5547fed1585cfac087df5dd456de0f0d1bfc
BLAKE2b-256 checksum
How to use checksums
56a34684eec91f5dcaa8a6995c356d5e0fbeec682382e43750eae524db044187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 28, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.20250728.1 This release

2 release files

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