Does Ansible have a module for forking a github repo?

Viewed 250

We have a project which requires a github repo to be forked. Can Ansible do this? (I looked through the docs and google searched it and found nothing).

Is the best option using the github API?

2 Answers

Ansible can execute any command you want on a remote host through an SSH session.

That means you can use any API or even simple script you want to fork/clone your project.
If you can achieve that through git commands in a script, you can make Ansible execute that same script.

In answer to your title question: no, Ansible does not currently have a module specifically for git that does forking. You can use the shell and command module (which are not idempotent).

The only modules for git commands are git and git_config.

With the git module you can create and switch to a branch using the version parameter if that scratches your itch.
i.e.

- git:
    repo: 'https://github.com/<username>/<repo>.git'
    dest: /path/to/repo
    version: test-branch
Related