Skip to content

About

Command-line client for Ansible Automation Platform

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

45 Commits

Folders and files

Repository files navigation

python-aapclient

License Python AI Assisted

⚠️ This tool is under active development, features may not work entirely or as expected. Use at your own risk!! ⚠️

A command-line client for Ansible Automation Platform (AAP) that provides a unified interface for managing AAP resources.

Installation

While under development, this package can be installed from a local repository clone in a Python virtual environment.

git clone https://github.com/jce-redhat/python-aapclient.git
cd python-aapclient
python3 -m venv .venv
source .venv/bin/activate
pip install -e .

Configuration

Configure the AAP connection using either environment variables or an .env file. Connection information may also be passed as command-line arguments.

Environment Variables (Recommended)

export AAP_HOST=https://your-aap-host.example.com
# use token authentication
export AAP_TOKEN=your-token
# OR username and password authentication
export AAP_USERNAME=your-username
export AAP_PASSWORD=your-password
# Optional SSL configuration (defaults shown)
export AAP_VERIFY_SSL=true          # Enable/disable SSL certificate verification (default: true)
export AAP_CA_BUNDLE=""             # Path to custom CA certificate bundle (default: none)

An .env file

Create a .env file in your project directory:

# Copy the example and edit with your details
cp env.example .env

Example .env file:

# Required: AAP server hostname or URL
AAP_HOST=https://aap-host.example.com/

# Authentication: Use either token OR username/password
AAP_TOKEN=your-aap-token

# OR use username/password authentication
# AAP_USERNAME=your-username
# AAP_PASSWORD=your-password

# Optional: SSL verification (default: true)
# AAP_VERIFY_SSL=false

# Optional: CA bundle for custom certificates
# AAP_CA_BUNDLE=/path/to/ca-bundle.crt

# Optional: Request timeout in seconds (default: 30)
# AAP_TIMEOUT=60

Quick Start

  1. Configure authentication:
export AAP_HOST=https://your-aap-instance.example.com
export AAP_TOKEN=your-api-token
  1. Enable command completion:
source <(aap complete)
  1. Test connectivity:
aap ping
  1. List available commands:
aap --help
  1. Explore resources:
aap organization list
aap project list
aap inventory list
  1. Command-specific help:
aap team create -h
aap credential set -h

All commands follow a consistent pattern:

aap <resource> <action> [options] [arguments]

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

About

Command-line client for Ansible Automation Platform

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages