The roles/trojan/tasks/main.yml playbook downloads a trojan-go zip archive to /tmp/trojan-go.zip, then attempts to extract it using ansible.builtin.unarchive with dest: /tmp/trojan-go-extract/. The Ansible unarchive module requires the destination directory to already exist on the remote host — it does not create it automatically. No task in the playbook creates this directory, causing a fatal failure on line 23.
Goals:
/tmp/trojan-go-extract/ exists before the unarchive task runsNon-Goals:
Add an ansible.builtin.file task with state: directory immediately before the existing unarchive task (line 23). This is the most direct fix and matches the pattern already used elsewhere in the same playbook (e.g., line 9-15 for the config directory).
Alternatives considered:
unarchive with a different dest that already exists (e.g., /tmp/): would pollute /tmp with extra files and require filtering logic.create_dest: yes-style parameter: no such parameter exists in Ansible's unarchive module./tmp/trojan-go-extract on success. On failure mid-playbook, the directory persists but /tmp is volatile and cleaned on reboot.