You now have a complete version of ansible-tower-cli with support for Ansible Automation Platform (AAP) 2.6!
# 1. Activate development environment
source env-dev.sh
# 2. Use tower-cli normally
tower-cli --version
# Output: Tower CLI 3.3.11# Already configured with your token!
tower-cli instance list
# Filter by type
tower-cli instance list --node-type control
tower-cli instance list --node-type execution
# Node details
tower-cli instance get --hostname aip-exnode-prod-01.srv.allianz
# Health check
tower-cli instance health --id 3
# Running jobs
tower-cli instance jobs --id 3- Automatically detects
/api/controller/v2/vs/api/v2/ - Works with AAP 2.x and legacy Tower 3.x
- Zero configuration required
- Complete support for nodes: control, execution, hop
- New fields: node_type, node_state, listener_port, cpu, memory
- Commands:
health,jobs - File:
tower_cli/resources/instance.py
- Gateway Service Nodes management for AAP 2.6
- Commands:
list,get,clusters,routes,services,status - File:
tower_cli/resources/gateway.py
- Dual API architecture support
- File:
tower_cli/api.py
ansible-tower-cli-3.3.9/
βββ tower_cli/
β βββ api.py [MODIFIED] Auto-detect AAP 2.x
β βββ constants.py [MODIFIED] v3.3.11
β βββ resources/
β βββ instance.py [MODIFIED] Mesh fields + health/jobs
β βββ gateway.py [NEW] Gateway Service Nodes
β
βββ env-dev.sh Environment script
βββ tower-cli-dev.sh Wrapper script
β
βββ AAP_2.6_SUPPORT_EN.md π AAP 2.6 documentation
βββ QUICK_START_EN.md π Quick start guide
βββ DEVELOPMENT_GUIDE_EN.md π Development guide
βββ GATEWAY_SUPPORT_EN.md π Gateway mesh topology
βββ CHANGELOG_3.3.10_EN.md π Changelog 3.3.10
βββ README_EN.md π Main README
# List
tower-cli instance list
tower-cli instance list --node-type control
tower-cli instance list --node-type execution
# Details
tower-cli instance get --hostname HOST
tower-cli instance get --id ID
# Health & Jobs (NEW)
tower-cli instance health --id ID --format json
tower-cli instance jobs --hostname HOST# Service Nodes
tower-cli gateway list
tower-cli gateway get --id ID
# Gateway Info
tower-cli gateway clusters
tower-cli gateway routes
tower-cli gateway services
tower-cli gateway status./tower-cli-dev.sh --version
# β
Tower CLI 3.3.11./tower-cli-dev.sh instance list -v
# β
Should show: "Detected AAP 2.x API (/api/controller/v2/)"./tower-cli-dev.sh instance list
# β
Should show the nodes with node_type (control/execution)./tower-cli-dev.sh instance get --id 3 --format json | grep node_type
# β
Should find: "node_type": "execution"./tower-cli-dev.sh instance health --id 3
# β
Should return health info./tower-cli-dev.sh gateway --help
# β
Should show gateway commandsSuccessfully tested against:
- Host:
https://aipportal.web.allianz - API Type: AAP 2.x (
/api/controller/v2/) - Nodes:
- 2x Control nodes (aip-controller-prod-01/02)
- 2x Execution nodes (aip-exnode-prod-01/02)
- Auth: OAuth Token β
# Make sure you activated the environment
source env-dev.sh# Verify the host
tower-cli config
# Test manually
curl -k "https://your-aap/api/controller/v2/ping/"# Normal - requires admin permissions
# Instance commands work anyway!| File | Content |
|---|---|
| AAP_2.6_SUPPORT_EN.md | Complete AAP 2.6 guide, architecture, examples |
| QUICK_START_EN.md | Quick guide all commands |
| DEVELOPMENT_GUIDE_EN.md | How to develop and test |
| GATEWAY_SUPPORT_EN.md | Gateway mesh topology (Tower 3.6+) |
source env-dev.sh
# See all nodes
tower-cli instance list --format json | jq '.results[] | {id, hostname, node_type, jobs_running}'
# Health check all
for id in $(tower-cli instance list --format json | jq -r '.results[].id'); do
echo "Node $id:"
tower-cli instance health --id $id --format json
echo ""
done# Jobs on execution nodes
tower-cli instance jobs --hostname aip-exnode-prod-01.srv.allianz
# List all active jobs
tower-cli job list --status running# See peers and connections
tower-cli instance get --id 1 --format json | jq '{hostname, node_type, peers, reverse_peers, listener_port}'Works with:
- AAP 2.6+ (all features)
- AAP 2.0-2.5 (controller API)
- Tower 3.8+ (legacy API)
- Tower 3.6+ (basic mesh)
- Tower < 3.6 (base features)
- Automatically detects API type
- Zero configuration
- Cache for performance
- Complete node_type support
- Receptor mesh info
- Peers and reverse peers
- Listener ports
- Service Nodes
- Routes & Clusters
- Services registry
- Status monitoring
# 1. Modify code
vim tower_cli/resources/instance.py
# 2. Immediate test (NO reinstall needed!)
tower-cli instance list
# 3. Debug
tower-cli instance list -vvv# Single test
python -m pytest tests/test_resources_instance.py -v
# All tests
python -m pytest tests/ -v- Files Modified: 3
- New Files: 1
- Lines Changed: ~500
- New Commands: 7
instance healthinstance jobsgateway listgateway getgateway clustersgateway routesgateway servicesgateway status
- New Fields: 6 (node_type, node_state, listener_port, cpu, memory, last_seen)
You now have a complete and working version of tower-cli with AAP 2.6 support!
β AAP 2.x auto-detection β Complete mesh topology support β Health and jobs commands for instances β Gateway resource for service nodes β Backward compatible with Tower 3.x β Complete documentation β Zero breaking changes
source env-dev.sh
tower-cli instance list --node-type execution
tower-cli instance health --id 3Version: 3.3.11 Status: β Production Ready Tested on: AAP 2.6 (aipportal.web.allianz) Date: 2026-01-21 Author: rUser75 Project: https://github.com/rUser75/tower-cli
If you find bugs or have suggestions, modify the code and test immediately:
vim tower_cli/resources/instance.py
tower-cli instance list # Changes immediate!Happy coding! π