Job template creator

From RHEcosystemAppEng/agentic-plugins · View interactive version

Job template creator is an AI agent skill from the GitHub repository RHEcosystemAppEng/agentic-plugins. Create AAP (Ansible Automation Platform) job templates for executing playbooks. Use when users request: - "Create a job template for this playbook" - "Set up a template to run remediation playbooks" - "Configure AAP to execute this playbook" - "Add a new job template for CVE remediation" This skill

How to use this skill

Skill file

AAP Job Template Creator Skill

This skill helps SREs create AAP job templates for executing Ansible playbooks, particularly for CVE remediation workflows.

Prerequisites

Required AAP Components:

Required MCP Servers: aap-mcp-job-management (setup guide)

Currently Available MCP Tools (read-only):

Missing MCP Tools (needed for creation):

Required Environment Variables:

Prerequisite Validation

CRITICAL: Before executing operations, execute the /mcp-aap-validator skill to verify AAP MCP server availability.

Validation freshness: Can skip if already validated in this session..

How to invoke: Execute the /mcp-aap-validator skill

Handle validation result:

Current Limitation: No Create Tools Available

⚠️ IMPORTANT: The current AAP MCP implementation does NOT include tools to create job templates programmatically. The available MCP tools are read-only (list, retrieve, launch).

Current Approach:

This skill documents both the current manual workflow and the intended automated workflow for when creation tools become available.

When to Use This Skill

Use this skill when you need:

Do NOT use this skill when:

Invocation from playbook-executor

When invoked from the playbook-executor skill (Scenario 3 - No suitable template), this skill receives playbook content in context. The playbook-executor invokes with an instruction such as:

Create a job template for this remediation playbook. Playbook: [content]. Filename: [filename]. Path: [our_playbook_path]. CVE: [cve_id]. Target systems: [list].

When playbook content is provided:

Phase 0 - Check context: If playbook content is provided by the invoking skill, execute the git flow (write, add, commit with confirmation checkpoint, push) before guiding template creation. Otherwise, use the existing manual flow where the user supplies the playbook.

Workflow

Phase 0: Validate AAP MCP Prerequisites

Action: Execute the /mcp-aap-validator skill

Note: Can skip if validation was performed earlier in this session and succeeded..

How to invoke: Execute the /mcp-aap-validator skill

Handle validation result:

Phase 1: Prepare Playbook in Git Project

Goal: Add playbook to a Git repository AAP can access.

Read references/01-git-setup.md for Option A (existing repo) and Option B (new repo).

Verification: Playbook committed, pushed, AAP synced, playbook path noted.

Phase 2: Gather Required Information

Before creating a job template, collect:

  1. Playbook Information:
  1. Target Information:
  1. Credentials:
  1. Execution Settings:

Phase 3: Verify Prerequisites

Step 1: List Available Projects

MCP Tool: projects_list (from aap-mcp-job-management)

Parameters:

Expected Output:

{
  "count": 1,
  "results": [
    {
      "id": 6,
      "name": "Remediation Playbooks",
      "scm_type": "git",
      "scm_url": "https://github.com/org/playbooks.git",
      "status": "successful"
    }
  ]
}

Action: Identify the project ID where your playbook is stored.

Step 2: List Available Inventories

MCP Tool: inventories_list (from aap-mcp-inventory-management)

Parameters:

Expected Output:

{
  "count": 1,
  "results": [
    {
      "id": 1,
      "name": "Production Inventory",
      "total_hosts": 150,
      "has_active_failures": false
    }
  ]
}

Action: Identify the inventory ID containing your target hosts.

Step 3: Verify Credentials

Note: The current AAP MCP doesn't expose credential listing tools. You'll need credential IDs from AAP Web UI or administrator.

Phase 4: Create Job Template via AAP Web UI

⚠️ CURRENT LIMITATION: AAP MCP has no create tools. Template creation must be done via AAP Web UI.

Read references/02-web-ui-form.md for form fields and steps.

Required: Name, Inventory, Project, Playbook, Credentials. Enable Privilege Escalation. Prompt on Launch: Job Type (REQUIRED), Variables, Limit.

Phase 5: Verify Template Creation

MCP Tool: job_templates_list (from aap-mcp-job-management)

Parameters:

Expected Output:

{
  "results": [
    {
      "id": 42,
      "name": "Remediate CVE-2025-49794",
      "playbook": "remediation-CVE-2025-49794.yml",
      "project": 6,
      "inventory": 1,
      "status": "never updated"
    }
  ]
}

Success Criteria:

Phase 6: Test Template Execution (Optional)

MCP Tool: job_templates_launch_retrieve (from aap-mcp-job-management)

Parameters:

Expected Output:

{
  "job": 1234,
  "status": "pending",
  "url": "/api/controller/v2/jobs/1234/"
}

Follow-up: Use playbook-executor skill to track job execution.

Output and Examples

Read references/03-output-template.md for report format.

Read references/04-examples.md for CVE remediation and dynamic variable examples.

Dependencies

Required MCP Servers

Required MCP Tools (Current)

Missing MCP Tools (Needed for Full Automation)

Related Skills

Reference Documentation

Best Practices

  1. Use descriptive template names - Include CVE ID or purpose: "Remediate CVE-2025-49794"
  2. Enable variable prompts for flexibility - Check "Variables" in the "Prompt on Launch" section for dynamic values
  3. Set appropriate timeouts - CVE remediation can take time; set generous timeouts
  4. Use privilege escalation - Most remediation requires sudo/root access
  5. Document template purpose - Use description field to explain usage
  6. Version playbooks - Keep playbooks in Git for change tracking
  7. Test templates first - Use check mode or test inventory before production
  8. Set concurrent limits - Prevent overwhelming infrastructure with simultaneous jobs
  9. Enable notifications - Configure email/webhook alerts for job completion
  10. Regular template audits - Review and update templates as playbooks evolve

Human-in-the-Loop Requirements

This skill requires user confirmation for:

  1. Git Operations (adding playbook to repository):
  1. Manual Template Creation (AAP Web UI):
  1. Test Execution (optional verification):

Never assume approval - always wait for explicit user confirmation.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.