Skip to content

Commit f1b9d0b

Browse files
committed
services/nomad/mirror: Enable rsync on mirrors
1 parent c0692d6 commit f1b9d0b

3 files changed

Lines changed: 34 additions & 1 deletion

File tree

ansible/hashi-worker.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
- "*filter"
2828
- "-A INPUT -p tcp --dport 80 -j ACCEPT"
2929
- "-A INPUT -p tcp --dport 443 -j ACCEPT"
30+
- "-A INPUT -p tcp --dport 873 -j ACCEPT"
3031
- "COMMIT"
3132

3233
- hosts: hashimx

services/nomad/infrastructure/traefik.nomad

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ job "traefik" {
3838

3939
config {
4040
image = "traefik:2.5.3"
41+
ports = ["http", "https", "traefik"]
4142

4243
args = [
4344
"--api.dashboard",

services/nomad/mirror/mirror.nomad

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ job "mirror" {
33
datacenters = ["VOID-MIRROR"]
44
namespace = "mirror"
55

6-
group "http" {
6+
group "services" {
77
network {
88
mode = "bridge"
99
port "http" { to = 80 }
10+
port "rsync" {
11+
to = 873
12+
static = 873
13+
}
1014
}
1115

1216
volume "root-mirror" {
@@ -30,12 +34,39 @@ job "mirror" {
3034

3135
config {
3236
image = "ghcr.io/void-linux/infra-nginx:v20210926rc01"
37+
ports = ["http"]
3338
}
3439

3540
volume_mount {
3641
volume = "root-mirror"
3742
destination = "/srv/www"
3843
}
3944
}
45+
46+
task "rsync" {
47+
driver = "docker"
48+
49+
config {
50+
image = "ghcr.io/void-linux/infra-rsync:v20210926rc01"
51+
ports = ["rsync"]
52+
volumes = ["local/voidmirror.conf:/etc/rsyncd.conf.d/voidmirror.conf"]
53+
}
54+
55+
volume_mount {
56+
volume = "root-mirror"
57+
destination = "/srv/rsync"
58+
}
59+
60+
template {
61+
data = <<EOF
62+
[voidlinux]
63+
comment = Main Void Repository
64+
path = /srv/rsync
65+
read only = yes
66+
list = yes
67+
EOF
68+
destination = "local/voidmirror.conf"
69+
}
70+
}
4071
}
4172
}

0 commit comments

Comments
 (0)