waft.agent_deployment.ansible_inventory module

Dynamic Ansible inventory generator from WAFT configuration.

This module generates Ansible inventory in JSON format from WAFT’s configuration file, enabling Ansible playbooks to target systems managed by WAFT.

class waft.agent_deployment.ansible_inventory.AnsibleInventoryGenerator(config_path: str | Path | None = None)

Bases: object

Generate Ansible inventory from WAFT configuration.

generate_inventory() dict[str, Any]

Generate Ansible inventory in JSON format.

Creates inventory with: - Platform-based groups (linux, windows, macos) - WAFT group mappings (prefixed with waft_group_) - Host variables for SSH connection

Returns:

Dictionary in Ansible dynamic inventory format

print_inventory()

Print inventory in Ansible JSON format to stdout.

waft.agent_deployment.ansible_inventory.main()

Main entry point for dynamic Ansible inventory script.

This function is called when the script is executed directly by Ansible. It supports the standard Ansible dynamic inventory interface: - –list: Return full inventory - –host <hostname>: Return variables for specific host - –config <path>: Use specific WAFT config file