forked from SimpleGateway/sg-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.yml
81 lines (66 loc) · 2.35 KB
/
main.yml
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
---
- name: Configure external interface
template: src=etc/hostname.ext dest=/etc/hostname.{{ ext_if }} owner=root group=wheel mode=0640
notify:
- netstart
- name: Configure internal interface
template: src=etc/hostname.int dest=/etc/hostname.{{ int_if }} owner=root group=wheel mode=0640
notify:
- netstart
- name: Configure hostname
template: src=etc/myname dest=/etc/myname owner=root group=wheel mode=0644
notify:
- netstart
- name: Configure firewall
template: src=etc/pf.conf dest=/etc/pf.conf owner=root group=wheel mode=0600
notify:
- pf
- name: Configure dhcpd
template: src=etc/dhcpd.conf dest=/etc/dhcpd.conf owner=root group=wheel mode=0644
notify:
- dhcpd
- name: Configure ntpd
template: src=etc/ntpd.conf dest=/etc/ntpd.conf owner=root group=wheel mode=0644
notify:
- ntpd
- name: Copy common config
copy: src={{ item }} dest=/{{ item }} owner=root group=wheel mode=0644
with_items:
- etc/pkg.conf
- etc/rc.securelevel
- etc/sysctl.conf
- name: Create rc.conf.local.d
file: path=/etc/rc.conf.local.d state=directory owner=root group=wheel mode=0644
- name: Enable base services
template: src=etc/rc.conf.local dest=/etc/rc.conf.local.d/00-base owner=root group=wheel mode=0644
notify:
- rc.conf.local
- unbound
- nsd
- dhcpd
- name: Build unbound keys
command: unbound-control-setup creates=/var/unbound/etc/unbound_server.pem
notify:
- unbound
- name: Configure unbound
template: src=var/unbound/etc/unbound.conf dest=/var/unbound/etc/unbound.conf owner=root group=wheel mode=0644
notify:
- unbound
- name: Build nsd keys
command: nsd-control-setup creates=/var/nsd/etc/nsd_server.pem
notify:
- nsd
- name: Configure nsd
template: src=var/nsd/etc/nsd.conf dest=/var/nsd/etc/nsd.conf owner=root group=_nsd mode=0640
notify:
- nsd
- name: Copy nsd zone file
template: src=var/nsd/zones/default.zone dest=/var/nsd/zones/{{ domain }} owner=root group=wheel mode=0644
notify:
- nsd
- name: Configure nsd reverse zone
template: src=var/nsd/zones/default.rDNS dest=/var/nsd/zones/{{ gw_network | regex_replace('^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$','\\3.\\2.\\1')}}.in-addr.arpa owner=root group=wheel mode=0644
notify:
- nsd
- name: Configure resolv.conf
template: src=etc/resolv.conf dest=/etc/resolv.conf owner=root group=wheel mode=0644