community / community.general / 6.6.8 / 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 (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
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: true state: present force_defaults: false 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: description: - Whether the repository should be private or not. - Defaults to C(false) if I(force_defaults=true), which is the default in this module. - Defaults to C(false) if I(force_defaults=false) when creating a new repository. - 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: description: - Description for the repository. - Defaults to empty if I(force_defaults=true), which is the default in this module. - Defaults to empty if I(force_defaults=false) when creating a new 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 force_defaults: default: true description: - Overwrite current I(description) and I(private) attributes with defaults if set to C(true), which currently is the default. - The default for this option will be deprecated in a future version of this collection, and eventually change to C(false). required: false type: bool version_added: 4.1.0 version_added_collection: community.general
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