-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy_homelab_set_static_dns.yml
126 lines (111 loc) · 5.1 KB
/
deploy_homelab_set_static_dns.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
- name: Manage DNS
hosts: ubnt-erx-krs
strategy: linear
gather_facts: false
vars:
dn: "{{ inventory__homelab_domain }}"
ip_plex: 192.168.10.10
ip_spnas: 192.168.10.11
ip_dev: 192.168.10.12
ip_mgmt: 192.168.11.2
ip_stats: 192.168.12.98
# ip_mail: 192.168.12.250
# ip_rp: 192.168.12.254
# ip_pihole: 192.168.16.2
# ip_projects: 192.168.12.251
ip_ha: 192.168.20.10
ip_spbleq12: 192.168.20.3
ip_gw_wg: 192.168.13.2
ip_k8s_ingress: 192.168.13.240
dns_entries:
- { alias: "plex", inet: "{{ ip_plex }}" }
- { alias: "traefik-plex", inet: "{{ ip_plex }}" }
# - { alias: "ombi", inet: "{{ ip_plex }}" }
# - { alias: "tautulli", inet: "{{ ip_plex }}" }
- { alias: "spnas", inet: "{{ ip_spnas }}" }
# - { alias: "cloud", inet: "{{ ip_spnas }}" }
- { alias: "traefik-spnas", inet: "{{ ip_spnas }}" }
- { alias: "minio", inet: "{{ ip_spnas }}" }
- { alias: "s3", inet: "{{ ip_spnas }}" }
- { alias: "deluge", inet: "{{ ip_k8s_ingress }}" }
- { alias: "jackett", inet: "{{ ip_k8s_ingress }}" }
- { alias: "monitorrent", inet: "{{ ip_k8s_ingress }}" }
- { alias: "sonarr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "radarr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "lidarr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "bazarr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "prowlarr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "flaresolverr", inet: "{{ ip_k8s_ingress }}" }
- { alias: "portainer", inet: "{{ ip_k8s_ingress }}" }
- { alias: "unifi-ui", inet: "{{ ip_k8s_ingress }}" }
- { alias: "dev", inet: "{{ ip_dev }}" }
- { alias: "traefik-dev", inet: "{{ ip_dev }}" }
- { alias: "git", inet: "{{ ip_dev }}" }
- { alias: "jenkins", inet: "{{ ip_dev }}" }
- { alias: "nexus", inet: "{{ ip_dev }}" }
# - { alias: "code", inet: "{{ ip_dev }}" }
# - { alias: "drone", inet: "{{ ip_dev }}" }
# - { alias: "registry", inet: "{{ ip_dev }}" }
- { alias: "mgmt", inet: "{{ ip_mgmt }}" }
- { alias: "traefik-mgmt", inet: "{{ ip_mgmt }}" }
# - { alias: "unms", inet: "{{ ip_mgmt }}" }
# - { alias: "bw", inet: "{{ ip_mgmt }}" }
- { alias: "ipa", inet: "{{ ip_mgmt }}" }
- { alias: "ldap", inet: "{{ ip_mgmt }}" }
# - { alias: "vault", inet: "{{ ip_mgmt }}" }
- { alias: "stats", inet: "{{ ip_stats }}" }
- { alias: "traefik-stats", inet: "{{ ip_stats }}" }
- { alias: "nms", inet: "{{ ip_stats }}" }
# - { alias: "grafana", inet: "{{ ip_stats }}" }
- { alias: "influxdb", inet: "{{ ip_stats }}" }
# - { alias: "loki", inet: "{{ ip_stats }}" }
# - { alias: "prometheus", inet: "{{ ip_stats }}" }
# - { alias: "mail", inet: "{{ ip_mail }}" }
# - { alias: "traefik-mail", inet: "{{ ip_mail }}" }
# - { alias: "rp", inet: "{{ ip_rp }}" }
# - { alias: "pihole", inet: "{{ ip_pihole }}" }
# - { alias: "traefik-pihole", inet: "{{ ip_pihole }}" }
# - { alias: "projects", inet: "{{ ip_projects }}" }
# - { alias: "traefik-projects", inet: "{{ ip_projects }}" }
- { alias: "spbleq12", inet: "{{ ip_spbleq12 }}" }
- { alias: "ha", inet: "{{ ip_ha }}" }
- { alias: "traefik-ha", inet: "{{ ip_ha }}" }
- { alias: "esp", inet: "{{ ip_ha }}" }
- { alias: "grocy", inet: "{{ ip_ha }}" }
- { alias: "gw-wg", inet: "{{ ip_gw_wg }}" }
- { alias: "unifi", inet: "192.168.13.250" }
- { alias: "k8s-controlplane-01", inet: "192.168.13.201" }
- { alias: "k8s-controlplane-02", inet: "192.168.13.202" }
- { alias: "k8s-controlplane-03", inet: "192.168.13.203" }
- { alias: "k8s-controlplane-04", inet: "192.168.13.204" }
- { alias: "k8s-controlplane-05", inet: "192.168.13.205" }
- { alias: "k8s-controlplane-06", inet: "192.168.13.206" }
- { alias: "k8s-lb-01", inet: "192.168.13.221" }
- { alias: "k8s-lb-02", inet: "192.168.13.222" }
- { alias: "k8s-lb-03", inet: "192.168.13.223" }
- { alias: "k8s-lb-04", inet: "192.168.13.224" }
- { alias: "k8s-worker-01", inet: "192.168.13.211" }
- { alias: "k8s-worker-02", inet: "192.168.13.212" }
- { alias: "k8s-worker-03", inet: "192.168.13.213" }
- { alias: "k8s-worker-04", inet: "192.168.13.214" }
- { alias: "k8s-worker-05", inet: "192.168.13.215" }
- { alias: "k8s-worker-06", inet: "192.168.13.216" }
tasks:
- name: Set static DNS mapping
community.network.edgeos_config:
lines:
- set system static-host-mapping host-name {{ dns_entry.alias }}.{{ dn }} inet {{ dns_entry.inet }}
- set system static-host-mapping host-name {{ dns_entry.alias }}.{{ dn }} alias {{ dns_entry.alias }}
loop_control:
loop_var: dns_entry
loop: "{{ dns_entries }}"
tags: [never, dns]
# - name: Delete static DNS mapping
# community.network.edgeos_config:
# lines:
# - delete system static-host-mapping host-name {{ dns_entry.alias }}.{{ dn }}
# loop_control:
# loop_var: dns_entry
# loop: "{{ dns_entries }}"
# tags: [never, dns]