community / community.general / 0.1.1 / module / gitlab_runner Create, modify and delete GitLab Runners. Authors: Samy Coenen (@SamyCoenen), Guillaume Martinez (@Lunik) preview | supported by communitycommunity.general.gitlab_runner (0.1.1) — module
Install with ansible-galaxy collection install community.general:==0.1.1
collections: - name: community.general version: 0.1.1
Register, update and delete runners with the GitLab API.
All operations are performed using the GitLab API v4.
For details, consult the full API documentation at U(https://docs.gitlab.com/ee/api/runners.html).
A valid private API token is required for all operations. You can create as many tokens as you like using the GitLab web interface at U(https://$GITLAB_URL/profile/personal_access_tokens).
A valid registration token is required for registering a new runner. To create shared runners, you need to ask your administrator to give you this token. It can be found at U(https://$GITLAB_URL/admin/runners/).
- name: "Register runner" gitlab_runner: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" registration_token: 4gfdsg345 description: Docker Machine t1 state: present active: True tag_list: ['docker'] run_untagged: False locked: False
- name: "Delete runner" gitlab_runner: api_url: https://gitlab.example.com/ api_token: "{{ access_token }}" description: Docker Machine t1 state: absent
state: choices: - present - absent default: present description: - Make sure that the runner with the same name exists with the same configuration or delete the runner with the same name. required: false type: str active: default: true description: - Define if the runners is immediately active after creation. required: false type: bool locked: default: false description: - Determines if the runner is locked or not. required: false type: bool api_url: description: - The resolvable endpoint for the API type: str tag_list: default: [] description: The tags that apply to the runner. required: false type: list api_token: description: - Your private token to interact with the GitLab API. required: true type: str description: aliases: - name description: - The unique name of the runner. required: true type: str access_level: choices: - ref_protected - not_protected default: ref_protected description: - Determines if a runner can pick up jobs from protected branches. required: false 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 run_untagged: default: true description: - Run untagged jobs or not. required: false type: bool validate_certs: default: true description: - Whether or not to validate SSL certs when supplying a https endpoint. type: bool maximum_timeout: default: 3600 description: - The maximum timeout that a runner has to pick up a specific job. required: false type: int registration_token: description: - The registration token is used to register new runners. required: true type: str
error: description: the error message returned by the GitLab API returned: failed sample: '400: path is already in use' type: str msg: description: Success or failure message returned: always sample: Success type: str result: description: json parsed response from the server returned: always type: dict runner: description: API object returned: always type: dict