aboutsummaryrefslogtreecommitdiffstats
path: root/playbook.yml
blob: ef51dcbf25364ead763f3fa0adea9914cd72aeeb (plain)
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
---
- name: Configure my FreeBSD home server
  hosts: pursotin

  pre_tasks:
    - name: Fail if secrets.yml wasn't loaded and smtp_user is missing
      assert:
        that:
          - smtp_user != ''
        fail_msg: >
          Required variables are missing. Did you forget to create a secrets.yml file?
      vars:
        ansible_assert_no_log: true

  vars_files:
    - secrets.yml
  vars:
    lan_ipv4_cidr: 192.168.0.10/16
    lan_ipv4_network: 192.168.0.0/16
    lan_ipv4_gateway: 192.168.0.1
    lan_search_domain: local.jan.systems
    jail_userland_version: 14.3-RELEASE
    jails:
      - { num: 1, name: ingress }
      - { num: 2, name: postgres }
      - { num: 3, name: irc_thelounge }
      - { num: 4, name: taulubot }
      - { num: 5, name: homepage }
      - { num: 6, name: hommabot }
      - { num: 7, name: aggro }
      - { num: 8, name: diddle }
      - { num: 11, name: spliit }
      - { num: 13, name: ente }
      - { num: 14, name: freshrss }
      - { num: 15, name: paste }
    ingress_routes:
      - { host: jan.systems, jail: homepage }
      - { host: jantuomi.fi, redirect: jan.systems }
      - { host: aggro.jan.systems, jail: aggro }
      - { host: diddle.jan.systems, jail: diddle }
      - { host: spliit.jan.systems, jail: spliit }
      - { host: freshrss.jan.systems, jail: freshrss }
      - { host: irc.jan.systems, jail: irc_thelounge }
      - { host: goaccess.jan.systems, static: /var/www/goaccess }
      - { host: paste.jan.systems, jail: paste }
    cert_domains:
      - "jan.systems"
      - "*.jan.systems"
      - "jantuomi.fi"
      - "*.jantuomi.fi"
    cert_name: "{{ cert_domains[0] }}"
    contact_email: jan@jantuomi.fi

  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

    - name: Run postgres jail tasks
      tags: [jail_postgres]
      import_tasks: tasks/jail_postgres.yml

    - name: Run diddle jail tasks
      tags: [jail_diddle]
      import_tasks: tasks/jail_diddle.yml

    - name: Run hommabot jail tasks
      tags: [jail_hommabot]
      import_tasks: tasks/jail_hommabot.yml

    - name: Run homepage jail tasks
      tags: [jail_homepage]
      import_tasks: tasks/jail_homepage.yml