Skip to content

Commit 359e42f

Browse files
committed
ansible: Provision b-hel-fi base spec
1 parent a21b161 commit 359e42f

7 files changed

Lines changed: 65 additions & 14 deletions

File tree

ansible/group_vars/prod.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ void_mesh:
7373
e-sfo3-us.m.voidlinux.org: 192.168.99.109
7474
f-sfo3-us.m.voidlinux.org: 192.168.99.111
7575
a-fsn-de.m.voidlinux.org: 192.168.99.112
76+
b-hel-fi.m.voidlinux.org: 192.168.99.113
7677

7778
consul_servers:
7879
- 192.168.99.104
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
network_interfaces:
3+
- name: eth0
4+
mode: static
5+
mode6: static
6+
resolvermode: static
7+
resolvermode6: disabled
8+
addresses:
9+
- 65.21.160.177/32
10+
resolvers:
11+
- 8.8.8.8
12+
routers:
13+
- 135.181.18.178
14+
addresses6:
15+
- 2a01:4f9:4b:42dc::d01/64
16+
17+
xbps_repository_address: alpha.de.repo.voidlinux.org
18+
xbps_repository_main: http://{{ xbps_repository_address }}/current/musl
19+
xbps_repository_nonfree: http://{{ xbps_repository_address }}/current/musl/nonfree
20+
xbps_repository_multilib: http://{{ xbps_repository_address }}/current/musl/multilib
21+
xbps_repository_multilib_nonfree: http://{{ xbps_repository_address }}/current/musl/multilib/nonfree
22+
23+
netlogon_use_cache: false

ansible/inventory

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ a-sfo3-us.m.voidlinux.org
3434
[netlogon]
3535
vm1.a-mci-us.m.voidlinux.org
3636
a-hel-fi.m.voidlinux.org
37+
b-hel-fi.m.voidlinux.org
3738
a-fsn-de.m.voidlinux.org
3839
b-lej-de.m.voidlinux.org
3940
c-lej-de.m.voidlinux.org
@@ -57,6 +58,7 @@ d-sfo3-us.m.voidlinux.org
5758

5859
[hashiworker]
5960
a-hel-fi.m.voidlinux.org
61+
b-hel-fi.m.voidlinux.org
6062
a-fsn-de.m.voidlinux.org
6163
b-lej-de.m.voidlinux.org
6264
c-lej-de.m.voidlinux.org
@@ -73,6 +75,7 @@ a-lej-de.m.voidlinux.org
7375

7476
[prod]
7577
a-hel-fi.m.voidlinux.org
78+
b-hel-fi.m.voidlinux.org
7679
a-mci-us.m.voidlinux.org
7780
a-fsn-de.m.voidlinux.org
7881
a-lej-de.m.voidlinux.org
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
---
22
netlogon_maintenance_user: maintenance
3+
4+
netlogon_use_cache: true

ansible/roles/netlogon/tasks/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,14 @@
3535
- NetKeys
3636
- NetAuth-localizer
3737
- NetAuth-pam-helper
38+
state: present
39+
40+
- name: Install PAM Cache
41+
xbps:
42+
pkg:
3843
- libpam-policycache
3944
state: present
45+
when: netlogon_use_cache
4046

4147
- name: Install localize Service (1/2)
4248
file:
@@ -66,9 +72,10 @@
6672
owner: root
6773
group: root
6874
mode: 0644
75+
when: netlogon_use_cache
6976

7077
- name: Configure PAM
71-
copy:
78+
template:
7279
src: system-auth
7380
dest: /etc/pam.d/system-auth
7481
owner: root

ansible/roles/netlogon/files/system-auth renamed to ansible/roles/netlogon/templates/system-auth

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
#%PAM-1.0
22

3+
{% if netlogon_use_cache %}
34
auth [success=4 default=ignore] pam_unix.so try_first_pass nullok
45
auth [success=3 default=ignore] pam_policycache.so try_first_pass action=check
56
auth [success=1 default=die] pam_exec.so expose_authtok quiet /usr/bin/pam-helper
67
auth required pam_deny.so
78
auth [default=ignore] pam_policycache.so action=update
89
auth required pam_env.so
910
auth required pam_permit.so
11+
{% else %}
12+
auth [success=2 default=ignore] pam_unix.so try_first_pass nullok
13+
auth [success=1 default=die] pam_exec.so expose_authtok quiet /usr/bin/pam-helper
14+
auth required pam_deny.so
15+
auth required pam_env.so
16+
auth required pam_permit.so
17+
{% endif %}
1018

1119
account required pam_unix.so
1220
account optional pam_permit.so

terraform/do/dns.tf

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ resource "digitalocean_record" "a_hel_fi" {
4545
value = "95.216.76.97"
4646
}
4747

48+
resource "digitalocean_record" "b_hel_fi" {
49+
domain = digitalocean_domain.voidlinux_org.name
50+
type = "A"
51+
name = "b-hel-fi.m"
52+
value = "65.21.160.177"
53+
}
54+
4855
resource "digitalocean_record" "a_fsn_de" {
4956
domain = digitalocean_domain.voidlinux_org.name
5057
type = "A"
@@ -245,9 +252,9 @@ resource "digitalocean_record" "repo_alpha_us" {
245252

246253
resource "digitalocean_record" "repo_shadow" {
247254
domain = digitalocean_domain.voidlinux_org.name
248-
type = "CNAME"
249-
name = "shadow.repo"
250-
value = "b-hel-fi.m.${digitalocean_domain.voidlinux_org.name}."
255+
type = "CNAME"
256+
name = "shadow.repo"
257+
value = "b-hel-fi.m.${digitalocean_domain.voidlinux_org.name}."
251258
}
252259

253260
###################################################################
@@ -267,23 +274,23 @@ resource "digitalocean_record" "verification_github" {
267274

268275

269276
resource "digitalocean_record" "mtmp_mx" {
270-
domain = digitalocean_domain.voidlinux_org.name
271-
type = "MX"
272-
name = "mtmp"
273-
value = "${digitalocean_record.f_sfo3_us.fqdn}."
277+
domain = digitalocean_domain.voidlinux_org.name
278+
type = "MX"
279+
name = "mtmp"
280+
value = "${digitalocean_record.f_sfo3_us.fqdn}."
274281
priority = 10
275282
}
276283

277284
resource "digitalocean_record" "mtmp" {
278285
domain = digitalocean_domain.voidlinux_org.name
279-
type = "A"
280-
name = "mtmp"
281-
value = digitalocean_droplet.f_sfo3_us.ipv4_address
286+
type = "A"
287+
name = "mtmp"
288+
value = digitalocean_droplet.f_sfo3_us.ipv4_address
282289
}
283290

284291
resource "digitalocean_record" "mtmp_spf" {
285292
domain = digitalocean_domain.voidlinux_org.name
286-
type = "TXT"
287-
name = "mtmp"
288-
value = "v=spf1 mx -all"
293+
type = "TXT"
294+
name = "mtmp"
295+
value = "v=spf1 mx -all"
289296
}

0 commit comments

Comments
 (0)