Using upward-relative src paths in Ansible copy or template tasks (for example, ../templates or ../files) can cause unpredictable file selection and accidental inclusion of sensitive files. The path is resolved against the current working directory, which may differ across control hosts or CI runs.
This rule examines tasks that use the modules copy, win_copy, template, win_template, ansible.builtin.copy, and ansible.builtin.template. Any task whose src property contains a ../<folder> segment referencing role folders (for example, ../files, ../templates, ../win_templates) is flagged.
Fix by placing assets in the role’s files/templates directories and referencing them by name, or use absolute paths or {{ role_path }} when necessary so src does not include upward-traversal segments.