Skip to content

Commit

Permalink
style: format
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDevMinerTV committed Nov 21, 2024
1 parent 69570a2 commit 593a3d5
Showing 1 changed file with 50 additions and 38 deletions.
88 changes: 50 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,33 @@ This Ansible role installs and configures GitLab runner.
untested and may not work out of the box with this role.

Currently supported operating systems:

- Debian 12
- Ubuntu Server 24.04

## Requirements

This role has been tested with the following dependencies:

`ansible_core` >= `2.17.1`
Ansible Collections
- `community.general` >= `9.2.0`
Python >= `3.11.2`

- `community.general` >= `9.2.0`
Python >= `3.11.2`

### Testing

- `molecule` >= `24.7.0`
- `molecule-plugins[docker]` >= `23.5.3`

## Role Variables

### Required

- `gitlab_access_token`: **Required.** GitLab Personal Access Token with `admin` scope.

### Optional

- `os_pkg_gitlab_runner`: Optional. Installation package name.
- `gitlab_gpg_key_url`: Optional. URL for GitLab's official gpg key.
- `gitlab_url`:Optional. URL of GitLab server.
Expand All @@ -35,56 +42,56 @@ Python >= `3.11.2`
- `runner_count`: Optional. The number of runner instances.
- `runner_name`: Optional. The runner's name.
- `runner_executor`: Optional. The runner's executor that is used to run your
builds.
builds.
- `runner_concurrent`: Optional. Limits how many jobs globally can be run
concurrently.
concurrently.
- `runner_builds_limit`: Optional. Maximum number of builds processed by a
runner.
runner.
- `runner_is_locked`: Optional. If true, runner cannot be assigned to other
projects.
projects.
- `runner_is_paused`: Optional. If true, runner will not receive any new jobs.
- `runner_run_untagged_builds`: Optional. Register to run untagged builds.
- `runner_tags`: Optional. List of tags.
- `runner_metrics_enabled`: Optional. If true, runner will expose Prometheus
metrics via embedded HTTP server.
metrics via embedded HTTP server.
- `runner_metrics_listen_address`. Optional. `<host>:<port>` address on which
the Prometheus metrics HTTP server should be listening (default: `':9252'`).
the Prometheus metrics HTTP server should be listening (default: `':9252'`).

- `runner_docker_image`: Optional. Docker image to be used.
- `runner_docker_privileged`: Optional. Give extended privileges to docker
container.
container.
- `runner_docker_services_timeout`: Optional. How long to wait for service
startup.
startup.
- `runner_stop_timeout`: Optional. Timeout in seconds for the service stop
command after which systemd will just `SIGKILL` the process.
command after which systemd will just `SIGKILL` the process.

- `runner_user`: Optional. User that will be used to run the runner. Only used
if `runner_executor` is set to `shell`.
if `runner_executor` is set to `shell`.
- `runner_group`: Optional. Group that will be used to run the runner. Only used
if `runner_executor` is set to `shell`.
if `runner_executor` is set to `shell`.

- `force_unregistration`: Optional. Force unregistration of all existing runners,
- `force_reregistration`: Optional. Force unregistration of all existing
runners before registration.
runners before registration.

- `runner_cleanup_is_enabled`: Optional. If true, GitLab Runner cleanup tool
will be used.
will be used.
- `runner_cleanup_container_name`: Optional. GitLab Runner cleanup container
name.
name.
- `runner_cleanup_container_image`: Optional. GitLab Runner cleanup container
image.
image.
- `runner_cleanup_volumes`: Optional. GitLab Runner cleanup volumes.
- `runner_cleanup_env`: Optional. GitLab Runner cleanup environment variables.

- `runner_config_path`: Optional. Path to GitLab Runner's configuration file
(TOML format).
(TOML format).

- `env_compose_http_timeout`: Optional. Value for `COMPOSE_HTTP_TIMEOUT`
environment variable injected to build environment.
environment variable injected to build environment.
- `env_docker_driver`: Optional. Value for `DOCKER_DRIVER` environment variable
injected to build environment.
injected to build environment.
- `env_docker_tls_certdir`: Optional. Value for `DOCKER_TLS_CERTDIR`
environment variable injected to build environment.
environment variable injected to build environment.

## Dependencies

Expand All @@ -107,31 +114,36 @@ environment variable injected to build environment.
For testing we use `Molecule` in combination with `Docker`.
For more information see:

- [Test requirements](molecule/default/INSTALL.rst)
- [Molecule](https://molecule.readthedocs.io/en/latest/)

Additionally we have two scenarios:

- Debian 12

1. Get a GitLab PAT with the `admin` scope.
2. For starting the tests, please run:
```bash
molecule test -- --extra-vars "gitlab_access_token=<TOKEN>"
```
For development you can also run the test step-by-step for Debian scenario:
```bash
# create testing environment
molecule create
# rollout Ansible config
molecule converge -- --extra-vars "gitlab_access_token=TOKEN_HERE"
# start tests
molecule verify
# login into the testing environment
molecule login --host <hostname_in_molecule.yml>
```

```bash
molecule test -- --extra-vars "gitlab_access_token=<TOKEN>"
```

For development you can also run the test step-by-step for Debian scenario:

```bash
# create testing environment
molecule create
# rollout Ansible config
molecule converge -- --extra-vars "gitlab_access_token=TOKEN_HERE"
# start tests
molecule verify
# login into the testing environment
molecule login --host <hostname_in_molecule.yml>
```

## License

Expand Down

0 comments on commit 593a3d5

Please sign in to comment.