1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
---
- name: Configure my FreeBSD home server
hosts: pursotin
pre_tasks:
- name: Fail if direnv wasn't loaded and SMTP_USER is missing
assert:
that:
- lookup('env', 'SMTP_USER') != ''
fail_msg: >
Required environment variables are missing. Did you forget to run `direnv allow` or load `.envrc`?
vars:
ansible_assert_no_log: true
vars:
smtp_user: "{{ lookup('env', 'SMTP_USER') }}"
smtp_password: "{{ lookup('env', 'SMTP_PASSWORD') }}"
smtp_host: "{{ lookup('env', 'SMTP_HOST') }}"
smtp_port: "{{ lookup('env', 'SMTP_PORT') }}"
dma_mail_hostname: "{{ lookup('env', 'DMA_MAILNAME') }}"
dma_to_address: "{{ lookup('env', 'DMA_TO_ADDRESS') }}"
hetzner_zone_id: "{{ lookup('env', 'HETZNER_ZONE_ID') }}"
hetzner_record_id: "{{ lookup('env', 'HETZNER_RECORD_ID') }}"
hetzner_pat: "{{ lookup('env', 'HETZNER_PAT') }}"
backup_ssh_host: "{{ lookup('env', 'BACKUP_SSH_HOST') }}"
backup_ssh_user: "{{ lookup('env', 'BACKUP_SSH_USER') }}"
backup_ssh_privkey_file: "{{ lookup('env', 'BACKUP_SSH_PRIVKEY_FILE') }}"
backup_ssh_pubkey_file: "{{ lookup('env', 'BACKUP_SSH_PUBKEY_FILE') }}"
backup_zfs_dataset: zroot
lan_ipv4_cidr: 192.168.0.10/16
lan_ipv4_gateway: 192.168.0.1
lan_search_domain: local.jan.systems
jail_userland_version: 14.3-RELEASE
jail_ingress_ip: "192.168.2.1"
jails:
- { name: ingress, num: 1 }
- { name: postgres, num: 2 }
- { name: irc_thelounge, num: 3 }
- { name: taulubot, num: 4 }
- { name: veetibot, num: 5 }
- { name: hommabot, num: 6 }
- { name: aggro, num: 7 }
- { name: diddle, num: 8 }
- { name: gallery_sakari, num: 9 }
- { name: gallery_leo, num: 10 }
- { name: spliit, num: 11 }
- { name: stirling-pdf, num: 12 }
- { name: ente, num: 13 }
static_sites:
- { site: "homepage", host: "jan.systems", tls: false }
- { site: "homepage", host: "pursotin.jan.systems", tls: true }
- { site: "homepage", host: "local.jan.systems", tls: false }
static_site_dirs:
homepage: "{{ lookup('env', 'JAN_SYSTEMS_HTML_DIR') }}"
tasks:
- name: Run general tasks
tags: [general]
import_tasks: tasks/general.yml
- name: Run network tasks
tags: [network]
import_tasks: tasks/network.yml
- name: Run email tasks
tags: [email]
import_tasks: tasks/email.yml
- name: Run ZFS tasks
tags: [zfs]
import_tasks: tasks/zfs.yml
- name: Run common jails tasks
tags: [jails]
import_tasks: tasks/jails.yml
- name: Run ingress jail tasks
tags: [jail_ingress]
import_tasks: tasks/jail_ingress.yml
|