|
43 | 43 | # * group
|
44 | 44 | # String, Group to be used in Service and directories.
|
45 | 45 | #
|
46 |
| - |
| 46 | +# * assured_labels |
| 47 | +# String, comma separated labels list to be use in the configuration script. |
| 48 | +# |
47 | 49 |
|
48 | 50 | class github_actions_runner (
|
49 | 51 | Enum['present', 'absent'] $ensure,
|
|
55 | 57 | String $repository_url,
|
56 | 58 | String $user,
|
57 | 59 | String $group,
|
| 60 | + String $assured_labels = undef, |
58 | 61 | String $hostname = $::facts['hostname'],
|
59 | 62 | Optional[Array[String]] $labels = undef,
|
60 | 63 | Optional[String] $repo_name = undef,
|
|
68 | 71 | $assured_labels="--labels ${flattend_labels_list}"
|
69 | 72 | }
|
70 | 73 |
|
71 |
| - if $github_actions_runner::repo_name { |
72 |
| - $url="https://github.com/${github_actions_runner::org_name}/${github_actions_runner::repo_name}" |
73 |
| - $token_url="https://api.github.com/repos/${github_actions_runner::org_name}/${github_actions_runner::repo_name}/actions/runners/registration-token" |
| 74 | + $url = $github_actions_runner::repo_name ? { |
| 75 | + undef => "https://github.com/${github_actions_runner::org_name}", |
| 76 | + default => "https://github.com/${github_actions_runner::org_name}/${github_actions_runner::repo_name}", |
74 | 77 | }
|
75 |
| - else { |
76 |
| - $url="https://github.com/${github_actions_runner::org_name}" |
77 |
| - $token_url="https://api.github.com/repos/${github_actions_runner::org_name}/actions/runners/registration-token" |
| 78 | + |
| 79 | + $token_url = $github_actions_runner::repo_name ? { |
| 80 | + undef => "https://api.github.com/repos/${github_actions_runner::org_name}/actions/runners/registration-token", |
| 81 | + default => "https://api.github.com/repos/${github_actions_runner::org_name}/${github_actions_runner::repo_name}/actions/runners/registration-token", |
78 | 82 | }
|
79 | 83 |
|
80 | 84 | class { '::github_actions_runner::config': }
|
|
0 commit comments