community / community.general / 3.8.10 / module / github_repo Manage your repositories on Github | "added in version" 2.2.0 of community.general" Authors: Álvaro Torres Cogollo (@atorrescogollo)community.general.github_repo (3.8.10) — module
Install with ansible-galaxy collection install community.general:==3.8.10
collections: - name: community.general version: 3.8.10
Manages Github repositories using PyGithub library.
Authentication can be done with I(access_token) or with I(username) and I(password).
- name: Create a Github repository community.general.github_repo: access_token: mytoken organization: MyOrganization name: myrepo description: "Just for fun" private: yes state: present register: result
- name: Delete the repository community.general.github_repo: username: octocat password: password organization: MyOrganization name: myrepo state: absent register: result
name: description: - Repository name. required: true type: str state: choices: - absent - present default: present description: - Whether the repository should exist or not. required: false type: str api_url: default: https://api.github.com description: - URL to the GitHub API if not using github.com but you own instance. type: str version_added: 3.5.0 version_added_collection: community.general private: default: false description: - Whether the new repository should be private or not. - This is only used when I(state) is C(present). required: false type: bool password: description: - Password used for authentication. - This is only needed when not using I(access_token). required: false type: str username: description: - Username used for authentication. - This is only needed when not using I(access_token). required: false type: str description: default: '' description: - Description for the repository. - This is only used when I(state) is C(present). required: false type: str access_token: description: - Token parameter for authentication. - This is only needed when not using I(username) and I(password). required: false type: str organization: description: - Organization for the repository. - When I(state) is C(present), the repository will be created in the current user profile. required: false type: str
repo: description: Repository information as JSON. See U(https://docs.github.com/en/rest/reference/repos#get-a-repository). returned: success and I(state) is C(present) type: dict