macunha1.github_actions_runner

<h1 align="center">Ansible Role for GitHub Actions Self-Hosted Runner</h1>

This Ansible role sets up and configures GitHub Actions self-hosted Runners on one or more servers. You can use it for different URLs (repositories or organizations) on the same server to maximize its use.

### Main Objectives of This Role:

- **Reduce Waste**: Use the same server to support multiple repositories or organizations.
- **Idempotence**: Running the role multiple times won't cause any issues; it has checks to see if steps need to be run.

## Variables

For a complete list of variables, see the [defaults](defaults/main.yaml) file. Each value includes comments explaining its purpose, and the default value indicates the type.

### Required Variables

The following values are essential since you cannot register the self-hosted Runner without them:

| Name                   | Description                                 |
| ---------------------- | ------------------------------------------- |
| gh_runner_config_url   | URL of the GitHub Repository or Organization |
| gh_runner_config_token | Token to authenticate the host for registration |

## Example Playbook

### Simple Use Case: Single Repository on One Server

```yaml
- hosts: foo
  roles:
    - role: macunha1.github_actions_runner
      vars:
        gh_runner_config_labels:
          - linux
          - self-hosted

        gh_runner_config_url: https://github.com/macunha1/ansible-github-actions-runner
        gh_runner_config_token: AC5TNLJP9SBAFNEKKLLBLF264J8XO

Complex Use Case

- hosts: foo
  roles:
    - role: macunha1.github_actions_runner
      vars:
        gh_runner_config_labels:
          - linux
          - self-hosted

        gh_runner_config_url: https://github.com/macunha1/ansible-github-actions-runner
        gh_runner_config_token: AC5TNLJP9SBAFNEKKLLBLF264J8XO

    - role: macunha1.github_actions_runner
      vars:
        gh_runner_config_url: https://github.com/macunha1/another-repository
        gh_runner_config_token: AC5CQV3IJRR2OAFGEFCPJ0WJPJQXO

    - role: macunha1.github_actions_runner
      vars:
        gh_runner_config_url: https://github.com/macunha-acme-corp
        gh_runner_config_token: ACYWUR9MHGR9U58C34W9ZK00UNBF

Each GitHub Actions Runner configuration will have its own path and credentials, allowing them to work together without conflicts, even on the same server.

Contribute

PRs Welcome

Feel free to create an issue for feature requests or, even better, submit a Pull request. I'm happy to collaborate with you.

If this role doesn't work for you or you encounter a bug during execution, please let me know. ```

Informazioni sul progetto

Idempotent Ansible role that installs and configures self-hosted GitHub Actions Runners (yeah, plural!)

Installa
ansible-galaxy install macunha1.github_actions_runner
Licenza
mit
Download
3.9k
Proprietario
cat /dev/null > /path/to/github/bio