Ansible Creator

raw JSON →
26.4.2 verified Mon Apr 27 auth: no python

A CLI tool for scaffolding Ansible Content (roles, playbooks, collections, etc.). Currently at version 26.4.2, with frequent releases following Ansible's release cadence.

pip install ansible-creator
error ModuleNotFoundError: No module named 'ansible_creator'
cause Trying to import using the wrong package name (e.g., ansible.creator or ansible_creator with hyphen).
fix
Use 'from ansible_creator.cli import AnsibleCreator' (underscore only).
error TypeError: init() missing 1 required positional argument: 'type'
cause Calling init without the --type argument.
fix
Provide --type: e.g., 'ansible-creator init --type role --path ./new_role'.
breaking In version 25.x, the CLI entry point was moved from 'ansible-creator' (with hyphen) to 'ansible-creator' (underscore is not used). Scripts relying on the old command name may fail.
fix Update scripts to use 'ansible-creator' command.
breaking The init command required '--type' argument is mandatory; omitting it raises a TypeError.
fix Always specify --type (role, playbook, collection, etc.).
deprecated The '--output' flag has been deprecated in favor of '--path'. Using --output will still work but emits a warning and may be removed in future.
fix Replace --output with --path.
pip install ansible-creator==26.4.2

Initialize AnsibeCreator and scaffold a role.

from ansible_creator.cli import AnsibleCreator
import os

# Initialize the creator (uses environment vars for config)
creator = AnsibleCreator()
# Scaffold a new Ansible role
creator.run(['init', '--type', 'role', '--path', './my_role'])