Skip to content

Repository files navigation

Paved Path Action

A GitHub Action for registering Ansible Automation Platform (AAP) workflows using a unified JSON specification.

Features

  • 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

Auto-Creation of Job Templates

The action automatically creates missing job templates that follow the naming convention {service_name}-state. These job templates:

  • Use the state.yml playbook
  • 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

Example Auto-Created Job Templates

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

Usage

Basic Usage

- 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 File Format

{
  "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"]
    }
  ]
}

Requirements

  • AAP API access with appropriate permissions
  • A default project in AAP (will be created if missing)
  • The state.yml playbook in your AAP project

Configuration

Environment Variables

  • AAP_HOST: AAP base URL
  • AAP_TOKEN: AAP API token
  • AAP_ORG: Organization name (defaults to "TORC")

Inputs

  • aap_url: AAP base URL
  • aap_token: AAP API token
  • workflow_file: Path to workflow JSON file

Error Handling

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)

Examples

See the infrastructure/compositions/ directory for example workflow files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages