community / community.general / 8.5.0 / module / gitlab_branch Create or delete a branch | "added in version" 4.2.0 of community.general" Authors: paytroff (@paytroff)community.general.gitlab_branch (8.5.0) — module
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
This module allows to create or delete branches.
- name: Create branch branch2 from main community.general.gitlab_branch: api_url: https://gitlab.com api_token: secret_access_token project: "group1/project1" branch: branch2 ref_branch: main state: present
- name: Delete branch branch2 community.general.gitlab_branch: api_url: https://gitlab.com api_token: secret_access_token project: "group1/project1" branch: branch2 state: absent
state: choices: - present - absent default: present description: - Create or delete branch. type: str branch: description: - The name of the branch that needs to be created. required: true type: str api_url: description: - The resolvable endpoint for the API. type: str ca_path: description: - The CA certificates bundle to use to verify GitLab server certificate. type: str version_added: 8.1.0 version_added_collection: community.general project: description: - The path or name of the project. required: true type: str api_token: description: - GitLab access token with API permissions. type: str ref_branch: description: - Reference branch to create from. - This must be specified if O(state=present). type: str api_password: description: - The password to use for authentication against the API. type: str api_username: description: - The username to use for authentication against the API. type: str api_job_token: description: - GitLab CI job token for logging in. type: str version_added: 4.2.0 version_added_collection: community.general validate_certs: default: true description: - Whether or not to validate SSL certs when supplying a HTTPS endpoint. type: bool api_oauth_token: description: - GitLab OAuth token for logging in. type: str version_added: 4.2.0 version_added_collection: community.general