Skip to content

Conversation

danielefranceschi
Copy link
Contributor

Description

Add support for enterprise-owned Github runners.

Setting vars.github_enterprise to your enterprise name and using a PAT with the proper rights, you can install+register enterprise-managed runners.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update (README updated)
  • Small minor change not affecting the Ansible Role code (Github Actions Workflow, Documentation etc.)

How Has This Been Tested?

Well, of course I've tested it locally, this is what I can show you:

TASK [danielefranceschi.github_actions_runner : START and enable Github Actions Runner service (Linux)] **********************************************************
task path: /home/daniele/.ansible/roles/danielefranceschi.github_actions_runner/tasks/install_runner.yml:120
changed: [github-runner-01] => {"changed": true, "cmd": ["./svc.sh", "start"], "delta": "0:00:00.042938", "end": "2023-08-02 11:15:00.562493", "msg": "", "rc": 0, "start": "2023-08-02 11:15:00.519555", "stderr": "", "stderr_lines": [],
"stdout": "\n/etc/systemd/system/actions.runner.enterprises-REDACTED.github-runner-01.service\n* actions.runner.enterprises-REDACTED.github-runner-01.service - GitHub Actions Runner (enterprises-REDACTED.github-runner-01)\n     Loaded: loaded (/etc/systemd/system/actions.runner.enterprises-REDACTED.github-runner-01.service; enabled; vendor preset: enabled)\n     Active: active (running) since Wed 2023-08-02 11:15:00 EST; 8ms ago\n   Main PID: 9726 (runsvc.sh)\n      Tasks: 2 (limit: 9402)\n     Memory: 592.0K\n        CPU: 6ms\n     CGroup: /system.slice/actions.runner.enterprises-REDACTED.github-runner-01.service\n             ├─9726 /bin/bash /opt/actions-runner/runsvc.sh\n             └─9729 ./externals/node16/bin/node ./bin/RunnerService.js\n\nAug 02 11:15:00 github-runner-01 systemd[1]: Started GitHub Actions Runner (enterprises-REDACTED.github-runner-01).\nAug 02 11:15:00 github-runner-01 runsvc.sh[9726]: .path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin",
"stdout_lines": ["", "/etc/systemd/system/actions.runner.enterprises-REDACTED.github-runner-01.service", "* actions.runner.enterprises-REDACTED.github-runner-01.service - GitHub Actions Runner (enterprises-REDACTED.github-runner-01)", "     Loaded: loaded (/etc/systemd/system/actions.runner.enterprises-REDACTED.github-runner-01.service; enabled; vendor preset: enabled)", "     Active: active (running) since Wed 2023-08-02 11:15:00 EST; 8ms ago", "   Main PID: 9726 (runsvc.sh)", "      Tasks: 2 (limit: 9402)", "     Memory: 592.0K", "        CPU: 6ms", "     CGroup: /system.slice/actions.runner.enterprises-REDACTED.github-runner-01.service", "             ├─9726 /bin/bash /opt/actions-runner/runsvc.sh", "             └─9729 ./externals/node16/bin/node ./bin/RunnerService.js", "", "Aug 02 11:15:00 github-runner-01 systemd[1]: Started GitHub Actions Runner (enterprises-REDACTED.github-runner-01).", "Aug 02 11:15:00 github-runner-01 runsvc.sh[9726]: .path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"]}

changes made to the code

  • assert.yml: disable org/account checks when enterprise is given
  • collect_info.yml: set runner API URL for enterprises
  • install_runner.yml: set GH full URL for enterprises

Minor changes for (aggressive IMO) linting here and there.

Copy link
Owner

@MonolithProjects MonolithProjects left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MonolithProjects MonolithProjects merged commit d6844c6 into MonolithProjects:master Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants