A GitHub Action for registering Ansible Automation Platform (AAP) workflows using a unified JSON specification.
- Unified Workflow Registration: Register complex AAP workflows from a single JSON file
- Automatic Job Template Creation: Automatically creates missing job templates that end in
-state - Parallel Node Support: Handles multiple parent nodes converging to a single child node
- Error Handling: Comprehensive error handling and logging
The action automatically creates missing job templates that follow the naming convention {service_name}-state. These job templates:
- Use the
state.ymlplaybook - Are configured with the same organization and inventory as the workflow
- Have variables enabled for launch-time configuration
- Are created with a descriptive name and description
When registering a workflow with nodes like:
{
"identifier": "resource_group",
"job_template": "resource_group-state"
}If resource_group-state doesn't exist in AAP, it will be automatically created with:
- Name:
resource_group-state - Playbook:
state.yml - Organization: Same as workflow
- Inventory: Same as workflow
- Description:
Auto-generated job template for resource_group-state state management
- name: Register AAP Workflow
uses: torc-poc/paved-path@main
with:
aap_url: https://aap.torc.run
workflow_file: infrastructure/compositions/my-workflow.json
aap_token: ${{ secrets.AAP_TOKEN }}{
"workflow": "my-workflow",
"description": "My workflow description",
"organization": 2,
"inventory": 4,
"nodes": [
{
"identifier": "start",
"job_template": "torc.run",
"success_nodes": ["resource_group"],
"failure_nodes": ["notify-failure"]
},
{
"identifier": "resource_group",
"job_template": "resource_group-state",
"vars": {
"service_name": "resource_group"
},
"success_nodes": ["network"],
"failure_nodes": ["notify-failure"]
}
]
}- AAP API access with appropriate permissions
- A default project in AAP (will be created if missing)
- The
state.ymlplaybook in your AAP project
AAP_HOST: AAP base URLAAP_TOKEN: AAP API tokenAAP_ORG: Organization name (defaults to "TORC")
aap_url: AAP base URLaap_token: AAP API tokenworkflow_file: Path to workflow JSON file
The action provides detailed logging for:
- Missing job templates (with auto-creation attempts)
- Workflow registration failures
- Node creation and linking issues
- Project creation (if needed)
See the infrastructure/compositions/ directory for example workflow files.