group-accessor-syntax

Status: IN

When hosts are added with `groups=["minecraft"]`, all modules for that group are accessible via `ftl.minecraft.module()` — the group name becomes a proxy attribute on the automation context.

Source: repo:ftl2-servercraft/ftl2_servercraft/scripts/neoforge.py

Example

# Register host in a group
ftl.add_host(hostname="server1", ansible_host=ip,
             ansible_user="root", groups=["minecraft"])

# Access modules via group name
await ftl.minecraft.shell(cmd="systemctl status game-server")
await ftl.minecraft.copy(src="config.yml", dest="/opt/game/config.yml")
await ftl.minecraft.service(name="game-server", state="restarted")

JSON