Skip to content

Commit 14a9d6d

Browse files
Improved documentation regarding hetzner and github settings
1 parent e397b3a commit 14a9d6d

2 files changed

Lines changed: 60 additions & 15 deletions

File tree

README.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,67 @@ This repository provides the functionality to deploy the github actions runner o
77
| Variable | Type | Default value | Description |
88
|----------|------|---------------|-------------|
99
| `hcloud_token` | string | "" | Defines the authentication token with which new machines are registered with the [hetzner cloud](https://www.hetzner.com/cloud). |
10-
| `hetzner_machine_type` | string | "cx11" | Define the machine type to be used. |
10+
| `ssh_private_key` | string | "~/.ssh/id_rsa" | Defines the path to the location of the private key. The private key is used together with the public key to connect to the machine. |
11+
| `ssh_public_key` | string | "~/.ssh/id_rsa.pub" | Defines the path to the location of the public key. The public key is used together with the private key to connect to the machine. |
12+
| `ssh_key_name` | string | `admin_ssh_key` | Defines the name for the ssh key added to the hetzner cloud. |
13+
| `hetzner_machine_type` | string | "cx11" | Sets the machine type to use. |
1114
| `hetzner_machine_os` | string | "debian-10" | Defines the machine operating system to be installed. |
12-
| `github_actions_provision_url` | string | "" | Specifies the location to use for registering new devices. Can be a repository or a company. Example: `https://github.com/programmfabrik/terraform-hetzner-github-actions`. |
13-
| `github_actions_provision_token` | string | "" | Defines the authentication token used to register new Github action runners. |
14-
| `github_actions_runner_replace_existing` | bool | false | Specifies whether to replace existing Github action runners with the same name. |
15+
| `hetzner_additional_public_key_ids` | []string | [] | Adds public keys to the server that are already registered with hetzner |
16+
| `github_owner` | string | | Defines the organisation name or repository owner. |
17+
| `github_repository_name` | string | | Sets the name of the repository. This option is only used if you use self-hosted Github runners at the repository level. |
18+
| `github_authentication_user` | string | | Sets the user used for issuing new registration tokens. Ensure that the user has the appropriate permissions. |
19+
| `github_authentication_token` | string | | Sets the personal access token for the configured user in the variable `github_authentication_user`. |
20+
| `hetzner_machine_additional_packages` | string | "" | Defines additional packages that must be installed on the machine. Each package name must be separated by a space ` `. |
21+
| `github_actions_runner_count` | number | 1 | Defines the number of runners to be provided. This option is equal to Machines at hetzner. |
1522
| `github_actions_runner_labels` | string | "" | Defines a list of labels used to identify the runners. The list is divided by separating the individual entries with `,`. |
23+
| `github_actions_runner_replace_existing` | bool | false | Specifies whether to replace existing Github action runners with the same name. |
24+
| `github_owner` | string | "" | Defines the organisation name or repository owner. |
25+
| `github_repository_name` | string | "" | Sets the name of the repository. This option is only used if you use self-hosted Github runners at the repository level. |
26+
| `github_authentication_user` | string | | Sets the user used for issuing new registration tokens. Ensure that the user has the appropriate permissions. |
27+
| `github_authentication_token` | string | | Sets the personal access token for the configured user in the variable github_authentication_user. |
28+
| `github_runner_type` | string | "repo" | Defines the github runner type. Available values are: repo, org |
1629

17-
## Example terraform.tfvars
30+
## Example terraform.tfvars, which provides the runners at repository level
1831

1932
```ini
20-
hcloud_token="my-hetzner-cloud-api-token"
33+
hcloud_token="<my-hcloud-token>"
2134

22-
hetzner_machine_type="cpx31"
35+
hetzner_machine_type="cx21"
2336
hetzner_machine_os="debian-10"
37+
hetzner_additional_public_key_ids=["username@local-system"]
38+
hetzner_machine_additional_packages=""
39+
40+
github_actions_runner_labels="example"
41+
github_actions_runner_replace_existing=false
42+
github_actions_runner_count=3
43+
44+
github_owner="example-repo-owner"
45+
github_repository_name="example-repo-name"
46+
github_authentication_user="example-bot"
47+
github_authentication_token="<example-bot personal access token>"
48+
49+
ssh_key_name="example-bot-ssh-key"
50+
```
51+
52+
## Example terraform.tfvars, which provides the runners at organisation level
53+
54+
```ini
55+
hcloud_token="<my-hcloud-token>"
56+
57+
hetzner_machine_type="cx21"
58+
hetzner_machine_os="debian-10"
59+
hetzner_additional_public_key_ids=["username@local-system"]
60+
hetzner_machine_additional_packages=""
61+
62+
github_actions_runner_labels="example"
63+
github_actions_runner_replace_existing=false
64+
github_actions_runner_count=3
65+
66+
github_owner="example-repo-owner"
67+
github_authentication_user="example-bot"
68+
github_authentication_token="<example-bot personal access token>"
2469

25-
github_actions_provision_url="https://github.com/programmfabrik/terraform-hetzner-github-actions"
26-
github_actions_provision_token="my-github-actions-register-token"
70+
ssh_key_name="example-bot-ssh-key"
2771

28-
github_actions_runner_replace_existing=true
29-
github_actions_runner_labels="debian-buster,debian-10"
72+
github_runner_type="org"
3073
```

variables.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ variable "hcloud_token" {
66
}
77

88
variable "ssh_private_key" {
9-
description = "Path to the location where the private key is stored to connect to the machines"
9+
description = "Defines the path to the location of the private key. The private key is used together with the public key to connect to the machine."
1010
default = "~/.ssh/id_rsa"
1111
type = string
1212
}
@@ -35,13 +35,13 @@ resource "hcloud_ssh_key" "admin_ssh_key" {
3535
}
3636

3737
variable "hetzner_machine_type" {
38-
description = "Defines the hetzner machine"
38+
description = "Sets the machine type to use."
3939
default = "cx11"
4040
type = string
4141
}
4242

4343
variable "hetzner_machine_os" {
44-
description = "Defines the hetzner machine operation system"
44+
description = "Defines the machine operating system to be installed."
4545
default = "debian-10"
4646
type = string
4747
}
@@ -53,7 +53,7 @@ variable hetzner_additional_public_key_ids {
5353
}
5454

5555
variable hetzner_machine_additional_packages {
56-
description = "Defines additional packages that must be installed on the machine."
56+
description = "Defines additional packages that must be installed on the machine. Each package name must be separated by a space ` `."
5757
default = ""
5858
type = string
5959
}
@@ -80,11 +80,13 @@ variable "github_actions_runner_replace_existing" {
8080

8181
variable "github_owner" {
8282
description = "Defines the organisation name or repository owner."
83+
default = ""
8384
type = string
8485
}
8586

8687
variable "github_repository_name" {
8788
description = "Sets the name of the repository. This option is only used if you use self-hosted Github runners at the repository level."
89+
default = ""
8890
type = string
8991
}
9092

0 commit comments

Comments
 (0)