package to make creating ansible workflows easy
Project description
ansible-easy
A YAML-driven Ansible playbook runner. Define your infrastructure configuration schema and playbook execution logic in YAML — no Python required.
ansible-easy is generic and can be used for any automation workflow. You define the schema, the conditions, and the playbook mappings — ansible-easy handles validation and execution.
Installation
pip install ansible-easy
How it works
ansible-easy has three concepts:
- Template — defines the schema of your config (field names, types, required/optional) and which playbooks to run and under what conditions
- Input — the actual values for a specific project, validated against the template
- Playbooks — standard Ansible playbooks that receive variables from the input via the mapping defined in the template
Usage
ansible-easy run \
--template ./config-templates/my-template.yaml \
--input ./workflow-input/my-input.yaml \
--playbooks-dir ./playbooks
Template config
Templates define the schema and playbook execution logic:
name: my_workflow
keys:
- name: environment
type: enum
possible_values:
- staging
- production
required: true
- name: app_role
type: str
required: false
- name: connection
type: object
required: true
keys:
- name: host
type: str
required: true
- name: port
type: int
required: true
playbooks:
- name: setup
condition:
type: always
mapping:
- ansible_variable_name: HOST
config_variable_name: connection.host
- name: configure_app_role
condition:
type: field_present
field: app_role
mapping:
- ansible_variable_name: APP_ROLE
config_variable_name: app_role
Supported field types
| Type | Description | Extra keys |
|---|---|---|
str |
String | — |
int |
Integer | — |
enum |
One of a fixed set of values | possible_values: [...] |
list |
List of strings | elements_type: str |
object |
Nested object with its own keys |
keys: [...] |
Condition types
| Type | Description |
|---|---|
always |
Playbook always runs |
field_present |
Runs only if the specified field has a value |
field_absent |
Runs only if the specified field is not provided |
Variable mapping
The mapping block maps your config fields to Ansible --extra-vars. Dot notation is supported for nested fields:
- ansible_variable_name: HOST
config_variable_name: connection.host
Logging
ansible-easy routes all Ansible output through Python's standard logging module:
2026-03-31 10:38:10 [INFO] [setup] [Create resource] ok (no change)
2026-03-31 10:38:12 [INFO] [setup] [Configure resource] changed
2026-03-31 10:38:14 [INFO] [setup] finished
Requirements
- Python 3.12+
ansible-runnerpydanticpyyaml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ansible_easy-0.0.1.tar.gz.
File metadata
- Download URL: ansible_easy-0.0.1.tar.gz
- Upload date:
- Size: 54.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89ebd580eed4372d9646d12ea89b3c6514d9e58be477436cc56687c8d14ab59e
|
|
| MD5 |
953afe750b34528c8cf6c2f0b8b1be44
|
|
| BLAKE2b-256 |
1f0832195b51c2b18bee28a73673692b998784ad256c47b320b951d726429f15
|
File details
Details for the file ansible_easy-0.0.1-py3-none-any.whl.
File metadata
- Download URL: ansible_easy-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ce5de853d0031593efec625fcada2b71f385f62712a1cc1a7b254179cdd807a7
|
|
| MD5 |
1a404d61a4a344322a3f7ad79a73e839
|
|
| BLAKE2b-256 |
a6d58af2d8456ebdb33c044fc7fcdd6baa784271dff6b190a20064bd8caf95bd
|