Overview

Date: 2026-05-11

Time: 15:45

Overview

This example demonstrates FTL2's Fully Qualified Collection Name (FQCN) module access pattern, which lets users call Ansible collection modules using Python's dot-notation attribute chaining (e.g., ftl.amazon.aws.ec2instance(...)). It shows how NamespaceProxy enables this syntax by building up namespace paths through successive getattr_ calls, ultimately producing a callable that executes the module via the automation context.

Usage Patterns

Two module access styles are supported within the automation() context manager:

Simple (FTL-native) modules — direct attribute access:


async with automation() as ftl:
    await ftl.file(path="/tmp/test", state="touch")
    await ftl.command(cmd="echo hello")

FQCN modules — chained namespace access for Ansible collections:


async with automation() as ftl:
    await ftl.amazon.aws.ec2_instance(name="web-server", instance_type="t3.micro")
    await ftl.ansible.builtin.debug(msg="Hello from FQCN!")
    await ftl.community.general.slack(token=ftl.secrets["SLACK_TOKEN"], channel="#deploy", msg="Done")

Both styles can be freely mixed in the same script. Simple modules are noted as "250x faster" since they're FTL-native rather than delegating to Ansible collections.

API and Configuration

Key Behaviors

Relationships