Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Support adding runner to runner groups #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ github_actions_runner::instances:
example_org_instance:
labels:
- self-hosted-custom
runner_group: 'MyRunners'
```

Note, your `personal_access_token` has to contain the `admin:org` permission.
Expand Down
4 changes: 4 additions & 0 deletions manifests/instance.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
# * labels
# Optional[Array[String]], A list of costum lables to add to a runner.
#
# * runner_group
# Optional[String[1]], The github runner group to add the runner to.
# * path
# Optional[Array[String]], List of paths to be used as PATH env in the instance runner. If not defined, file ".path" will be kept as created
# by the runner scripts. (Default: Value set by github_actions_runner Class)
Expand All @@ -67,6 +69,7 @@
Optional[String[1]] $no_proxy = $github_actions_runner::no_proxy,
Optional[Boolean] $disable_update = $github_actions_runner::disable_update,
Optional[Array[String[1]]] $labels = undef,
Optional[String[1]] $runner_group = undef,
Optional[String[1]] $enterprise_name = $github_actions_runner::enterprise_name,
Optional[String[1]] $org_name = $github_actions_runner::org_name,
Optional[String[1]] $repo_name = undef,
Expand Down Expand Up @@ -139,6 +142,7 @@
url => $url,
hostname => $hostname,
assured_labels => $assured_labels,
runner_group => $runner_group,
disable_update => $disable_update,
}),
notify => Exec["${instance_name}-run_configure_install_runner.sh"],
Expand Down
4 changes: 4 additions & 0 deletions templates/configure_install_runner.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
String $url,
String $hostname,
String $assured_labels,
Optional[String[1]] $runner_group = undef,
Boolean $disable_update,
| -%>
#!/bin/bash
Expand Down Expand Up @@ -33,6 +34,9 @@ export RUNNER_ALLOW_RUNASROOT=true
--name <%= $hostname %>-<%= $instance_name %> \
--url <%= $url %> \
--token ${TOKEN} \
<%- if $runner_group { -%>
--runnergroup <%= $runner_group %> \
<%- } -%>
<%- if $disable_update { -%>
--disableupdate \
<%- } -%>
Expand Down