Skip to content

Commit 2dbffb1

Browse files
committed
Merge group_vars/all into global-config/
1 parent e778647 commit 2dbffb1

File tree

13 files changed

+94
-113
lines changed

13 files changed

+94
-113
lines changed

global-config/bird-lg.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Bird looking glass settings
2+
birdlg_proxy_port: 5000
3+
birdlg_web_port: 5001
4+
birdlg_domain: "{{ dns_domain }}"
5+
birdlg_session_key: !vault |
6+
$ANSIBLE_VAULT;1.1;AES256
7+
31633232623465353431343863613532386539653964643337656534383533393330396566323831
8+
3766336435363063646334626531613264623862363965660a633331376634376330636461393162
9+
66663330613739343236383062393731316535383735336461613165363434396261326464653737
10+
6535393461656132380a383335313537346361633938396137336235323335643938316334663932
11+
39393431646137653435336335363562656133353264313061373434303939396663

global-config/dns-dn42.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### General DNS settings for dn42
1+
### DNS Recursor settings for dn42
22

33
# Parse the delegation server IPs and DNSSEC trust anchors from the registry
44
delegation_servers: "{{ lookup('file', 'dn42-registry/data/dns/delegation-servers.dn42') | regex_findall('^nserver:\\s+[a-z]\\.delegation-servers\\.dn42 ([0-9a-fA-F.:]+)$', multiline=True) }}"

global-config/dns-entries.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Custom DNS entries. This is read by scripts/make-dns-entries.py
1+
# Custom DNS entries. This is read by scripts/make-dns-entries.py to generate Bind-style zones under dns-zones/
22
dns_records:
33
"{{ dns_domain }}":
44
"@":

global-config/general.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
### Misc settings & AS-specific information
2+
ownas: "4242421080"
3+
ownnets4:
4+
- 172.20.229.112/28
5+
- 172.22.108.0/26
6+
ownnets6:
7+
- fd86:bad:11b7::/48
8+
9+
# Decommissioned nodes to cleanup resources for (e.g. Wireguard tunnels)
10+
cleanup_remove_nodes:
11+
- us-sea01
12+
13+
# DNS related settings
14+
# This is the main domain used for creating host records for routers (<shortname>.<dns_domains[0]>).
15+
# Other domains can be specified in global-config/dns-entries.yml
16+
dns_domain: "jlu5.dn42"
17+
dns_nameserver_prefix: "ns1" # used in zone files
18+
dns_ttl: 300
19+
dns_zones_dir: "/etc/powerdns/dns-zones"
20+
21+
# Anycast service IPs
22+
anycast_ip: "172.20.229.112"
23+
anycast_ip6: "fd86:bad:11b7:53::1"
24+
anycast_recursors_ip: "172.22.108.22"
25+
anycast_recursors_ip6: "fd86:bad:11b7:53::2"
26+
27+
# Dummy device names for IGP and Anycast
28+
# (I should've chose better names here because the script doesn't make changing these simple...)
29+
dummy_ifname: "igp-dummy0"
30+
dummy_ifname_anycast: "igp-dummy1"
31+
dummy_ifname_anycast_recursors: "igp-dummy2"
32+
dummy_ifname_glob: "igp-dummy*"
33+
34+
# Mitogen needs this to be set; it doesn't follow the interpreter_python setting in ansible.cfg yet
35+
# See https://github.com/dw/mitogen/issues/740
36+
ansible_python_interpreter: /usr/bin/python3
37+
38+
# Bird settings
39+
# See roles/config-bird2/config for the full Bird config
40+
bird_logs_dir: "/var/log/bird/"
41+
42+
# iptables (stateful firewall)
43+
# These files are passed into ip(6)tables-restore. If you already have rules here, the ones from this repo
44+
# will be merged under the *filter block.
45+
iptables_rules_path: "/etc/iptables/rules.v4"
46+
ip6tables_rules_path: "/etc/iptables/rules.v6"

global-config/netdata.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Netdata settings
2+
netdata_stock_config_dir: /usr/lib/netdata/conf.d
3+
netdata_user_config_dir: /etc/netdata
4+
5+
# Netdata Cloud settings
6+
netdata_register_cloud: true
7+
netdata_token: !vault |
8+
$ANSIBLE_VAULT;1.1;AES256
9+
63393366303337313432666138653838333739333037383235373863626438633265666566353932
10+
3563373764306134663335626336326639333765616331660a656531626235356237333337363935
11+
38616461626539303330373063346535623166653531663038396465376439653232326438303665
12+
3536356233373537300a303235303235333431396530306236383839663239383333363237333538
13+
34376664383765313265346663633666363837363766353538386461616235353766353736363239
14+
37396162353966326163323763613733656434373736376264386437363766666134373965383530
15+
32626464306165626637356535306537666662383837386334346134653638336430643933623234
16+
33613531343335356233343632306263373935333434623235636539653836363362356531386665
17+
32316136363061393436333166373137316130666536623835646437373762353632363935386661
18+
64346265626661633831356265333666633135383865363930346634323533383434313062346137
19+
303061313833363933326138376535666230
20+
netdata_room_ids: !vault |
21+
$ANSIBLE_VAULT;1.1;AES256
22+
36303330393866666664663138336661303761353262393033303437306437653963353666353337
23+
6663333566316439656334323539303730663337363362370a383433656663626539303966633766
24+
33326237313262336565643738666534303339343565653339616133323436316261653563383037
25+
6333316435383663350a386435386165613262316135626666656131396530613939353738316463
26+
66313436653363616439636161393036336536306461353761383932313739633931366431363938
27+
3362303537333536616639393735663038636366336533376133
28+
netdata_cloud_url: https://app.netdata.cloud

group_vars/all

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../global-config/

group_vars/all.yml

-82
This file was deleted.

roles/config-bird2/tasks/main.yml

-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@
3636
- Reconfigure bird
3737
###
3838

39-
- name: Read global-config settings
40-
include_vars:
41-
dir: "{{ playbook_dir }}/global-config/"
42-
ignore_unknown_extensions: true
43-
4439
- name: Write global bird settings (static)
4540
copy:
4641
src: "{{ item }}"

roles/config-iptables/tasks/main.yml

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
file: "{{ playbook_dir }}/roles/config-wireguard/config/{{ inventory_hostname }}.yml"
44
ignore_errors: true
55

6-
- name: Read IGP tunnel settings
7-
include_vars:
8-
file: "global-config/igp-tunnels.yml"
9-
106
- name: "Read iptables rules template"
117
set_fact:
128
iptables_rules: "{{ lookup('template', 'templates/rules.j2') }}"

roles/config-powerdns-recursor/tasks/main.yml

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
- name: Read global-config settings
2-
include_vars:
3-
dir: "{{ playbook_dir }}/global-config/"
4-
ignore_unknown_extensions: true
5-
61
- name: "Print delegation servers"
72
debug:
83
var: delegation_servers

roles/config-powerdns-zones/tasks/main.yml

-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
- name: Read global-config settings
2-
include_vars:
3-
dir: "{{ playbook_dir }}/global-config/"
4-
ignore_unknown_extensions: true
5-
61
- name: "Template named.conf for PowerDNS"
72
template:
83
src: "named.conf.j2"

roles/config-wireguard/tasks/main.yml

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
loop_var: peer_info
1818
when: peer_info.get('remove')
1919

20-
- name: Read IGP tunnel settings
21-
include_vars:
22-
file: "global-config/igp-tunnels.yml"
23-
2420
- name: Write Wireguard tunnel settings for internal nodes (v2)
2521
include_tasks: "write-wg-settings.yml"
2622
loop: "{{ igp_neighbours[inventory_hostname] | sort }}"

scripts/make-dns-records.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
This scripts looks at the following files:
66
- global-config/dns-entries.yml for custom DNS entries
7-
- group_vars/all.yml for general AS settings; specifically the following options:
7+
- global-config/general.yml for general AS settings; specifically the following options:
88
"ownnets4", "ownnets6", "dns_*"
99
- The inventory file (hosts.yml) to create host records for routers, unless --no-host-records is set
1010
-
@@ -155,15 +155,15 @@ def write_ptr6_zone(netblock):
155155
def _load_config():
156156
global hosts
157157
hosts = yaml_load(args.hosts)['dn42routers']['hosts']
158-
group_vars = yaml_load(args.group_vars)
158+
general_vars = yaml_load(args.general_conf)
159159

160160
# Follow Ansible templating for dns-entries.yml
161161
with open(args.dns_entries) as f:
162162
dns_entries_raw = f.read()
163163
dns_entries_tmpl = jinja2.Template(dns_entries_raw)
164-
dns_entries = yaml.full_load(dns_entries_tmpl.render(group_vars))
164+
dns_entries = yaml.full_load(dns_entries_tmpl.render(general_vars))
165165

166-
global_vars.update(group_vars)
166+
global_vars.update(general_vars)
167167
global_vars.update(dns_entries)
168168

169169
def main():
@@ -173,8 +173,8 @@ def main():
173173
type=str, default='hosts.yml')
174174
parser.add_argument("-D", "--dns-entries", help="path to DNS entries configuration",
175175
type=str, default='global-config/dns-entries.yml')
176-
parser.add_argument("-G", "--group-vars", help="path to group vars configuration",
177-
type=str, default='group_vars/all.yml')
176+
parser.add_argument("-G", "--general-conf", help="path to general configuration",
177+
type=str, default='global-config/general.yml')
178178
global args
179179
args = parser.parse_args()
180180

0 commit comments

Comments
 (0)