nick_invision.macos_github_actions_runner

macos-github-actions-runner

This role installs a self-hosted GitHub Actions runner on MacOS. It can do a fresh install, reinstall if needed, or uninstall. It is based on ansible-github_actions_runner but tailored for MacOS.

Requirements

You can only use this on MacOS 10.13 (High Sierra) or later.

These environment variables are necessary:

  • PERSONAL_ACCESS_TOKEN - A GitHub Personal Access Token (PAT) with repo scope for repo runners or admin:org scope for org runners.

These variables are required:

  • github_account - Your GitHub account name (case-sensitive). It can be a user name or an organization name.
  • access_token - Optional. This can replace the needed PERSONAL_ACCESS_TOKEN environment variable.

Role Variables

Default settings (from defaults/main.yml):

# User under which the local runner service will run
runner_user: "vagrant"

# Directory for installing the local runner
runner_dir: ~/actions-runner

# Version of the GitHub Actions Runner
runner_version: "latest"

# Reinstall the runner if already installed
reinstall_runner: no

# Hide sensitive Ansible logs (like registration tokens)
hide_sensitive_logs: yes

# GitHub URL
github_url: "https://github.com"

# GitHub API URL
github_api_url: "https://api.github.com"

# Your GitHub Personal Access Token
access_token: "{{ lookup('env', 'PERSONAL_ACCESS_TOKEN') }}"

# Is the runner for an organization?
runner_org: no

# Name for the runner in GitHub (default is system hostname)
runner_name: "{{ hostname }}"

# Labels for the runner
runner_labels: []

# Directory for runner's work
runner_work_dir: "_work"

# Additional arguments for `config.sh`
runner_extra_config_args: ""

Dependencies

None

Example Playbook

To set up a repo-level GitHub self-hosted runner:

- name: Install GitHub Actions Runner
  hosts: macs
  user: ansible
  become: yes
  vars:
    - github_account: github-access-user
    - github_repo: my_awesome_repo
  roles:
    - role: nick-invision.macos_github_actions_runner

To set up an org-level GitHub self-hosted runner:

- name: Install GitHub Actions Runner
  hosts: macs
  user: ansible
  become: yes
  vars:
    - github_account: github-access-user
    - runner_org: true
  roles:
    - role: nick-invision.macos_github_actions_runner

To set up a GitHub self-hosted runner with specific settings:

- name: Install GitHub Actions Runner
  hosts: macs
  user: ansible
  become: yes
  vars:
    - github_account: github-access-user
    - runner_org: true
    - runner_labels:
        - some-label
    - runner_version: 2.277.0
  roles:
    - role: nick-invision.macos_github_actions_runner

License

MIT

Informazioni sul progetto

Deploy Github Actions self-hosted runner on MacOS

Installa
ansible-galaxy install nick_invision.macos_github_actions_runner
Licenza
mit
Download
439
Proprietario