---
title: Gitlab Runner
slug: homologacao-atmosphere/gitlab-runner
description: Learn how to register, update, and delete runners using the GitLab API with this comprehensive document. It covers all the necessary parameters and their types, such as access level, active status, API token, API URL, and more. Discover how to create a ne
createdAt: 2021-03-16T14:05:20.000Z
---

## Resumo

- Registrar, atualizar e excluir runners com a API GitLab.

## Parâmetros

| **Parâmetros**                                      | **Tipo**               | **Escolhas \| Valor Padrão**                                         | **Comentários**                                                                                                      |
| --------------------------------------------------- | ---------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| access\_level                                       | string                 | Escolhas:<br />- ref\_protected<br />(default)<br />- not\_protected | Determina se um runner pode apanhar postos de trabalho em ramos protegidos.                                          |
| active                                              | boolean                | Escolhas:<br />- false<br />- true<br />(default)                    | Definir se os runners serão imediatamente ativos após a criação.                                                     |
| api\_token                                          | string                 |                                                                      | Token GitLab para login.                                                                                             |
| api\_url                                            | string                 |                                                                      | O caminho da API em formato URL.                                                                                     |
| description - *required*<br />**<br />aliases: name | string                 |                                                                      | O nome exclusivo do runner.<br /><br />                                                                              |
| locked                                              | boolean                | Escolhas:<br />- false<br />(default)<br />- true                    | Determina se o runner será ou não trancado.                                                                          |
| maximum\_timeout                                    | integer                | Default:<br />3600                                                   | O tempo máximo de espera que um runner tem para apanhar um trabalho específico.                                      |
| registration\_token                                 | string                 |                                                                      | O código de registo é utilizado para registar novos runners.                                                         |
| run\_untagged                                       | boolean                | Escolhas:<br />- false<br />- true<br />(default)                    | Executar ou não trabalhos não marcados.                                                                              |
| state                                               | string                 | Escolhas:<br />- present<br />(default)<br />- absent                | Certifique-se de que o runner com o mesmo nome existe com a mesma configuração ou elimine o runner com o mesmo nome. |
| tag\_list                                           | list / elements=string | Default:<br />\[]                                                    | As etiquetas que se aplicam ao runner.                                                                               |
| validate\_certs                                     | boolean                | Escolhas:<br />- false<br />- true<br />(default)                    | Validar ou não os certificados SSL ao fornecer uma url https.                                                        |



## Notas

- Para criar um novo runner, são necessárias pelo menos as opções api\_token, descrição e api\_url.
- Os runners precisam ter descrições únicas.



## Exemplos

```yaml
# Exemplo: Registrar 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

# Exemplo: Deletar runner
- gitlab_runner:
    api_url: https://gitlab.example.com/
    api_token: "{{ access_token }}"
    description: Docker Machine t1
    registration_token: 4gfdsg345
    state: absent
```



## Valores retornados

| **Chave** | **Tipo**   | **Retornado&#x20;**<br />**quando** | **Descrição**                                |
| --------- | ---------- | ----------------------------------- | -------------------------------------------- |
| error     | string     | Falhar                              | A mensagem de erro devolvida pelo GitLab API |
| msg       | string     | Sempre                              | Mensagem de sucesso ou falha.                |
| result    | dictionary | Sempre                              | Resposta json do servidor.                   |
| runner    | dictionary | Sempre                              | Objeto API.                                  |


