What is a Project?
A Project in AWX is a logical collection of Ansible playbooks, roles, and related files. Projects represent a playbook repository that can be synchronized from a source control system (Git, Subversion) or from a local directory. Projects are essential for organizing and versioning your Ansible automation content.Projects bridge the gap between your source control system and AWX, ensuring that jobs always run with the correct, versioned content.
Core Concepts
Project Types
AWX supports several SCM (Source Control Management) types for projects:- Manual: Playbooks are stored locally on the AWX server under
PROJECTS_ROOT - Git: Synchronize from Git repositories (most common)
- Subversion: Synchronize from SVN repositories
- Red Hat Insights: Pull playbooks from Red Hat Insights
- Remote Archive: Download and extract playbooks from a remote archive file
Key Fields
From the Project model (awx/main/models/projects.py:252):
| Field | Type | Description |
|---|---|---|
name | String | Project name (unique within organization) |
description | String | Optional description |
organization | ForeignKey | Organization that owns this project |
scm_type | Choice | Type of SCM (git, svn, insights, archive, or empty for manual) |
scm_url | String | Repository URL |
scm_branch | String | Specific branch, tag, or commit to checkout |
scm_refspec | String | Additional refspec to fetch (Git only) |
scm_clean | Boolean | Discard local changes before syncing |
scm_delete_on_update | Boolean | Delete project before syncing |
scm_track_submodules | Boolean | Track submodules’ latest commits |
credential | ForeignKey | SCM credential for authentication |
scm_update_on_launch | Boolean | Update project when launching a job |
scm_update_cache_timeout | Integer | Cache timeout in seconds |
allow_override | Boolean | Allow job templates to override SCM branch |
default_environment | ForeignKey | Default execution environment for jobs using this project |
signature_validation_credential | ForeignKey | Credential for validating content signatures |
How Projects Work
Project Updates
When a project is created or updated, AWX runs a Project Update job to synchronize content from the SCM:Project Status
Projects have several status states (projects.py:396-413):
- never updated: New project that hasn’t synced yet
- pending: Update job is queued
- running: Currently syncing from SCM
- successful: Last update succeeded
- failed: Last update failed
- error: Update encountered an error
- canceled: Update was canceled
- missing: Manual project with missing local path
- ok: Manual project with valid local path
Update on Launch
Projects can be configured to update automatically when a job is launched:scm_update_cache_timeout field controls how often updates can occur, preventing excessive syncing.
Playbook Discovery
AWX automatically discovers playbooks in the project directory:playbook_files field and shown when creating job templates.
Branch Override
Theallow_override field enables job templates to specify different branches:
Content Signing
Projects support GPG content signing for security:- Set the
signature_validation_credentialto a GPG public key credential - AWX validates playbooks and roles against signatures during project updates
- If validation fails, the project update fails with a specific error message
API Endpoints
List Projects
Create Project
Update Project
Trigger Project Update
Get Project Playbooks
Permissions
Projects have the following role types (projects.py:326-348):
- Admin Role: Full control over the project
- Use Role: Can use project in job templates
- Update Role: Can trigger project updates
- Read Role: Can view project details
Execution Environments
Projects have adefault_environment field that specifies which execution environment to use for jobs:
Best Practices
Use Source Control
Use Source Control
Always use Git or another SCM for projects rather than manual projects. This provides version control, collaboration, and rollback capabilities.
Enable Update on Launch
Enable Update on Launch
For development environments, enable
scm_update_on_launch to ensure jobs always use the latest code. For production, disable it and manually control updates.Set Cache Timeout
Set Cache Timeout
Use
scm_update_cache_timeout to prevent excessive updates. A value of 60-300 seconds is typically appropriate.Use Specific Branches
Use Specific Branches
Specify branches or tags in
scm_branch rather than using default branches to ensure consistency.Enable Content Signing
Enable Content Signing
For production environments, use GPG content signing to ensure playbook integrity.
Related Resources
- Job Templates - Use projects in job templates
- Execution Environments - Set default execution environment
- Credentials - Configure SCM credentials
- Organizations - Organize projects by organization