Coder Social home page Coder Social logo

ansible-role-macos-github-actions-runner's Introduction

macos-github-actions-runner

This role will install a GitHub Actions self-hosted runner at either the org or repo level on a MacOS/MacOSX. It will perform a clean install, reinstall if desired, reinstall if service is not running, or uninstall. Inspired heavily by ansible-github_actions_runner but modified to work with MacOS.

Requirements

This role should only be used on MacOS 10.13 (High Sierra) or newer.

The following environment variables are required:

  • PERSONAL_ACCESS_TOKEN - GitHub PAT with repo scope if adding repo runner or admin:org scope if adding org runner

The following variables are required:

  • github_account - The case-sensitive GitHub account name. This is either the GitHub user name, or the GitHub Organization name.
  • access_token - This is optional and takes the place of the required PERSONAL_ACCESS_TOKEN environment variable.

Role Variables

Defaults (from defaults/main.yml):

# Runner user - user under which is the local runner service running
runner_user: "vagrant"

# Directory where the local runner will be installed
runner_dir: ~/actions-runner

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

# If found on the server, delete already existing runner service and install it again
reinstall_runner: no

# Do not show Ansible logs which may contain sensitive data (registration token)
hide_sensitive_logs: yes

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

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

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

# Is it the runner for organization or not?
runner_org: no

# Name to assign to this runner in GitHub (System hostname as default)
runner_name: "{{ hostname }}"

# Labels to apply to the runner
runner_labels: []

# Labels to apply to the runner
runner_work_dir: "_work"

# Extra arguments to pass to `config.sh`
runner_extra_config_args: ""

Dependencies

None

Example Playbook

To configure 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 configure 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 configure a GitHub self-hosted runner with various overrides:

- 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

ansible-role-macos-github-actions-runner's People

Contributors

ichina avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.