In automation/vm-ansible-setup/playbooks/setup_vm_part2.yml
It has ansible.builtin.command: gh repo fork lewagon/data-engineering-challenges --remote
This causes during playbook run.
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["gh", "repo", "fork", "lewagon/data-engineering-challenges", "--remote"], "delta": "0:00:00.089997", "end": "2026-09-08 05:36:12.685628", "msg": "non-zero return code", "rc": 1, "start": "2026-09-08 05:36:12.595631", "stderr": "the--remoteflag is unsupported when a repository argument is provided\n\nUsage: gh repo fork [<repository>] [-- <gitflags>...] [flags]\n\nFlags:\n --clone Clone the fork\n --default-branch-only Only include the default branch in the fork\n --fork-name string Rename the forked repository\n --org string Create the fork in an organization\n --remote Add a git remote for the fork\n --remote-name string Specify the name for the new remote (default \"origin\")\n ", "stderr_lines": ["the--remoteflag is unsupported when a repository argument is provided", "", "Usage: gh repo fork [<repository>] [-- <gitflags>...] [flags]", "", "Flags:", " --clone Clone the fork", " --default-branch-only Only include the default branch in the fork", " --fork-name string Rename the forked repository", " --org string Create the fork in an organization", " --remote Add a git remote for the fork", " --remote-name string Specify the name for the new remote (default \"origin\")", " "], "stdout": "", "stdout_lines": []}
Why the Flag Failed
gh repo fork owner/repo is meant for creating a new fork on GitHub (and optionally cloning it via --clone).
gh repo fork --remote is meant for running inside an existing local git directory to create a fork on GitHub and attach it as a remote to your local folder.
Fix
change --remote to --clone
gh repo fork lewagon/data-engineering-challenges --clone
In automation/vm-ansible-setup/playbooks/setup_vm_part2.yml
It has
ansible.builtin.command: gh repo fork lewagon/data-engineering-challenges --remoteThis causes during playbook run.
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["gh", "repo", "fork", "lewagon/data-engineering-challenges", "--remote"], "delta": "0:00:00.089997", "end": "2026-09-08 05:36:12.685628", "msg": "non-zero return code", "rc": 1, "start": "2026-09-08 05:36:12.595631", "stderr": "the--remoteflag is unsupported when a repository argument is provided\n\nUsage: gh repo fork [<repository>] [-- <gitflags>...] [flags]\n\nFlags:\n --clone Clone the fork\n --default-branch-only Only include the default branch in the fork\n --fork-name string Rename the forked repository\n --org string Create the fork in an organization\n --remote Add a git remote for the fork\n --remote-name string Specify the name for the new remote (default \"origin\")\n ", "stderr_lines": ["the--remoteflag is unsupported when a repository argument is provided", "", "Usage: gh repo fork [<repository>] [-- <gitflags>...] [flags]", "", "Flags:", " --clone Clone the fork", " --default-branch-only Only include the default branch in the fork", " --fork-name string Rename the forked repository", " --org string Create the fork in an organization", " --remote Add a git remote for the fork", " --remote-name string Specify the name for the new remote (default \"origin\")", " "], "stdout": "", "stdout_lines": []}Why the Flag Failed
gh repo fork owner/repo is meant for creating a new fork on GitHub (and optionally cloning it via --clone).
gh repo fork --remote is meant for running inside an existing local git directory to create a fork on GitHub and attach it as a remote to your local folder.
Fix
change
--remoteto--clonegh repo fork lewagon/data-engineering-challenges --clone