File tree Expand file tree Collapse file tree 4 files changed +97
-0
lines changed Expand file tree Collapse file tree 4 files changed +97
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Apply - Terraform via ARC
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ env :
9
+ SOPS_AGE_KEY : ${{ secrets.SOPS_AGE_KEY }}
10
+
11
+ jobs :
12
+ deploy :
13
+ runs-on : arc-dind
14
+ container : image-registry.openshift-image-registry.svc:5000/arc-runners/terraform-runner:latest
15
+
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+
19
+ - name : Run Git as root
20
+ run : git config --global --add safe.directory '*'
21
+
22
+ - name : Install SSH key
23
+ uses : shimataro/ssh-key-action@v2
24
+ with :
25
+ key : ${{ secrets.SSH_PRIVATE_KEY }}
26
+
27
+ - name : Terraform apply
28
+ run : make apply
Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Plan - Terraform via ARC
3
+
4
+ on :
5
+ pull_request :
6
+ types : [opened, reopened, synchronize]
7
+ workflow_dispatch :
8
+
9
+ env :
10
+ SOPS_AGE_KEY : ${{ secrets.SOPS_AGE_KEY }}
11
+
12
+ jobs :
13
+ plan :
14
+ runs-on : arc-dind
15
+ container : image-registry.openshift-image-registry.svc:5000/arc-runners/terraform-runner:latest
16
+
17
+ steps :
18
+ - uses : actions/checkout@v4
19
+
20
+ - name : Run Git as root
21
+ run : git config --global --add safe.directory '*'
22
+
23
+ - name : Install SSH key
24
+ uses : shimataro/ssh-key-action@v2
25
+ with :
26
+ key : ${{ secrets.SSH_PRIVATE_KEY }}
27
+
28
+ - name : Run tests
29
+ run : make test
30
+
31
+ - name : Terraform plan
32
+ run : make plan
Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ No modules.
22
22
| Name | Type |
23
23
| ------| ------|
24
24
| [ libvirt_domain.runner] ( https://registry.terraform.io/providers/dmacvicar/libvirt/0.7.1/docs/resources/domain ) | resource |
25
+ | [ libvirt_domain.template-server] ( https://registry.terraform.io/providers/dmacvicar/libvirt/0.7.1/docs/resources/domain ) | resource |
25
26
| [ libvirt_volume.runner] ( https://registry.terraform.io/providers/dmacvicar/libvirt/0.7.1/docs/resources/volume ) | resource |
27
+ | [ libvirt_volume.template-server] ( https://registry.terraform.io/providers/dmacvicar/libvirt/0.7.1/docs/resources/volume ) | resource |
26
28
| [ sops_file.secret_vars] ( https://registry.terraform.io/providers/carlpett/sops/latest/docs/data-sources/file ) | data source |
27
29
28
30
## Inputs
Original file line number Diff line number Diff line change
1
+ resource "libvirt_volume" "template-server" {
2
+ name = " template-server.qcow2"
3
+ size = " 21474836480" # 20 Gigabyte to byte
4
+ }
5
+
6
+ resource "libvirt_domain" "template-server" {
7
+ name = " template-server"
8
+ description = " GitHub Actions self-hosted template-server"
9
+ cpu {
10
+ mode = " host-passthrough"
11
+ }
12
+ vcpu = " 1"
13
+ memory = " 4096"
14
+ disk {
15
+ file = data. sops_file . secret_vars . data [" fedora_server_path" ]
16
+ }
17
+ disk {
18
+ volume_id = libvirt_volume. template-server . id
19
+ }
20
+ network_interface {
21
+ network_name = " default"
22
+ }
23
+ network_interface {
24
+ network_name = " internal"
25
+ }
26
+ graphics {
27
+ type = " vnc"
28
+ listen_type = " none"
29
+ }
30
+ boot_device {
31
+ dev = [" cdrom" , " hd" ]
32
+ }
33
+ depends_on = [libvirt_volume . template-server ]
34
+ }
35
+
You can’t perform that action at this time.
0 commit comments