Date: 2026-05-11
Time: 15:13
This page covers FTL2's primary use case: executing automation modules on remote machines via SSH. It walks through setting up a Docker-based SSH target, configuring inventory for SSH connectivity, and running modules remotely. It also explains the internal "gate" mechanism that FTL2 uses to package and ship module code to remote hosts.
ansible_connection: ssh in inventory triggers the RemoteModuleRunner using the asyncssh library/tmp/, executes it with the remote Python interpreter, and reads results back via length-prefixed JSON protocol/tmp for reuse on subsequent runsansiblepythoninterpreter must point to a valid Python 3 path on the remote host — if wrong, gate execution failsInventory configuration for SSH:
all:
hosts:
remote-server:
ansible_host: 127.0.0.1
ansible_port: 2222
ansible_user: testuser
ansible_connection: ssh
ansible_python_interpreter: /usr/bin/python3
vars:
ansible_password: testpass
Core remote commands:
ftl2 -m ping -i inventory.yml # Test connectivity
ftl2 -m setup -i inventory.yml # Gather remote facts
ftl2 -m shell -i inventory.yml -a "cmd='uname -a'" # Run shell command
ftl2 -m file -i inventory.yml -a "path=/tmp/test.txt state=touch" # Create file
ftl2 -m copy -i inventory.yml -a "src=/tmp/local.txt dest=/tmp/remote.txt" # Copy file
ftl2 -m file -i inventory.yml -a "path=/tmp/test.txt state=absent" # Remove file
Verbose debugging:
ftl2 -m ping -i inventory.yml -vvv
Inspecting gates:
ls -la /tmp/ftl_gate_*.pyz
echo -n '0000000d["Hello", {}]' | python3 /tmp/ftl_gate_*.pyz
Key inventory fields: ansiblehost, ansibleport (default 22), ansibleuser, ansibleconnection, ansiblepythoninterpreter, vars.ansible_password
ping, setup, file, shell, copy) work identically in local and remote modesansiblehost, ansibleport, etc.) mirror Ansible conventions intentionally/tmp/ → execute with Python → return length-prefixed JSON resultsansible_connection: ssh is the inventory field that enables remote executionansiblepythoninterpreter must be set correctly or remote execution fails with "Python interpreter not found"vars.ansiblepassword; key auth uses ~/.ssh/idrsa by default with no password field needed-vvv flag enables verbose logging for troubleshooting remote executionStrictHostKeyChecking are for development only — production requires SSH keys, host key verification, and SSH agent forwarding