Skip to main content

No project description provided

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ans_env_loader-0.20250626.2.tar.gz (44.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ans_env_loader-0.20250626.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file ans_env_loader-0.20250626.2.tar.gz.

File metadata

  • Download URL: ans_env_loader-0.20250626.2.tar.gz
  • Upload date:
  • Size: 44.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for ans_env_loader-0.20250626.2.tar.gz
Algorithm Hash digest
SHA256 321186255c23dda0408c4744caa67d17e6b98d356c4201f14886476da45dac05
MD5 3ae31bc9e3ab841a46202809d88e9ba8
BLAKE2b-256 448bd5019ea2cf251d2471ec2dce2eecc57114ead5b7e6ff30334df7d863422c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ans_env_loader-0.20250626.2.tar.gz:

Publisher: pypi.yaml on level12/ans-env-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ans_env_loader-0.20250626.2-py3-none-any.whl.

File metadata

File hashes

Hashes for ans_env_loader-0.20250626.2-py3-none-any.whl
Algorithm Hash digest
SHA256 743179d7e11e67f70ccfe96629acf4f3532261b8e06f7a5a8c6848c784b2c9c5
MD5 b0ebfcb68dd51acda5eb386a3f7b28c0
BLAKE2b-256 5c6c5e4caa724e164d6f3c07bdda3b5171e5b9216b3f6a2a22959654ade4b4d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ans_env_loader-0.20250626.2-py3-none-any.whl:

Publisher: pypi.yaml on level12/ans-env-loader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page