Update network
This commit is contained in:
parent
318c638df7
commit
79497476c2
@ -1,17 +1,93 @@
|
|||||||
---
|
---
|
||||||
all:
|
all:
|
||||||
hosts:
|
hosts:
|
||||||
prusa.lan:
|
router:
|
||||||
iron-man.lan:
|
ansible_host: 192.168.50.2
|
||||||
router.lan:
|
vars:
|
||||||
|
ip: 2
|
||||||
|
mac: 2c:b0:5d:4a:72:62
|
||||||
|
bender:
|
||||||
|
ansible_host: 192.168.50.3
|
||||||
|
vars:
|
||||||
|
ip: 3
|
||||||
|
mac: e0:3f:49:6f:03:c2
|
||||||
|
|
||||||
|
home-assistant:
|
||||||
|
ansible_host: 192.168.50.5
|
||||||
|
vars:
|
||||||
|
ip: 5
|
||||||
|
mac: dc:a6:32:8b:7b:ab
|
||||||
|
mac2: 6a:1b:c8:63:58:7a
|
||||||
|
prusa:
|
||||||
|
ansible_host: 192.168.50.6
|
||||||
|
vars:
|
||||||
|
ip: 6
|
||||||
|
mac: b8:27:eb:96:f3:3f
|
||||||
|
mac2: b8:27:eb:c3:a6:6a
|
||||||
|
# rpi3-02:
|
||||||
|
iron-man:
|
||||||
|
ansible_host: 192.168.50.7
|
||||||
|
vars:
|
||||||
|
ip: 7
|
||||||
|
mac: b8:27:eb:19:f8:0d
|
||||||
|
rpi3a:
|
||||||
|
ansible_host: 192.168.50.8
|
||||||
|
vars:
|
||||||
|
ip: 8
|
||||||
|
mac: b8:27:eb:ff:2a:86
|
||||||
|
kvm-bender:
|
||||||
|
ansible_host: 192.168.50.11
|
||||||
|
vars:
|
||||||
|
ip: 11
|
||||||
|
mac: dc:a6:32:f6:63:c1
|
||||||
|
android-sgs9:
|
||||||
|
vars:
|
||||||
|
ip: 41
|
||||||
|
mac: 24:18:1d:bc:fe:4f
|
||||||
|
ipad:
|
||||||
|
vars:
|
||||||
|
ip: 42
|
||||||
|
mac: b8:63:4d:b6:4c:bc
|
||||||
|
node-01.lan:
|
||||||
|
ansible_host: 192.168.50.101
|
||||||
|
vars:
|
||||||
|
ip: 101
|
||||||
|
mac: dc:a6:32:03:6d:fa
|
||||||
|
node-02.lan:
|
||||||
|
ansible_host: 192.168.50.102
|
||||||
|
vars:
|
||||||
|
ip: 102
|
||||||
|
mac: dc:a6:32:3c:0f:ff
|
||||||
|
node-03.lan:
|
||||||
|
ansible_host: 192.168.50.103
|
||||||
|
vars:
|
||||||
|
ip: 103
|
||||||
|
mac: dc:a6:32:3c:1a:ec
|
||||||
|
node-x86.lan:
|
||||||
|
ansible_host: 192.168.50.186
|
||||||
|
vars:
|
||||||
|
ip: 186
|
||||||
|
children:
|
||||||
|
raspberry:
|
||||||
|
hosts:
|
||||||
|
node-01.lan:
|
||||||
|
node-02.lan:
|
||||||
|
node-03.lan:
|
||||||
|
lan:
|
||||||
|
hosts:
|
||||||
|
router:
|
||||||
|
bender:
|
||||||
|
home-assistant:
|
||||||
|
rpi3-01:
|
||||||
|
# rpi3-02:
|
||||||
|
iron-man:
|
||||||
|
prusa:
|
||||||
|
|
||||||
|
|
||||||
children:
|
children:
|
||||||
docker_cluster:
|
docker_cluster:
|
||||||
hosts:
|
hosts:
|
||||||
node-01.lan:
|
node-01.lan:
|
||||||
ansible_host: 192.168.50.101
|
|
||||||
node-02.lan:
|
node-02.lan:
|
||||||
ansible_host: 192.168.50.102
|
|
||||||
node-03.lan:
|
node-03.lan:
|
||||||
ansible_host: 192.168.50.103
|
|
||||||
node-x86.lan:
|
node-x86.lan:
|
||||||
ansible_host: 192.168.50.186
|
|
||||||
|
@ -12,3 +12,12 @@
|
|||||||
vars:
|
vars:
|
||||||
network: "{{ lan }}"
|
network: "{{ lan }}"
|
||||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||||
|
|
||||||
|
- name: Create db.lan
|
||||||
|
# become: yes
|
||||||
|
template:
|
||||||
|
src: etc/bind/db.reverse.j2
|
||||||
|
dest: build/dns/db.{{ lan.network_reverse }}
|
||||||
|
vars:
|
||||||
|
network: "{{ lan }}"
|
||||||
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||||
|
@ -8,7 +8,7 @@ $ORIGIN {{ network.network_name }}.
|
|||||||
86400;
|
86400;
|
||||||
)
|
)
|
||||||
|
|
||||||
@ IN NS dns.lan.
|
@ IN NS dns.{{ network.network_name }}.
|
||||||
|
|
||||||
DNS IN A {{ network.network_prefix }}.100
|
DNS IN A {{ network.network_prefix }}.100
|
||||||
|
|
||||||
|
15
roles/network/templates/etc/bind/db.reverse.j2
Normal file
15
roles/network/templates/etc/bind/db.reverse.j2
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
$TTL 86400
|
||||||
|
$ORIGIN {{ network.network_name }}.
|
||||||
|
@ IN SOA {{ network.network_name }}. dns.{{ network.network_name }}. (
|
||||||
|
{{ serial }};
|
||||||
|
604800;
|
||||||
|
86400;
|
||||||
|
2419200;
|
||||||
|
86400;
|
||||||
|
)
|
||||||
|
|
||||||
|
{{ network.network_reverse }} IN A dns.{{ network.network_name }}
|
||||||
|
|
||||||
|
{% for host in network.hosts %}
|
||||||
|
{{ host.ip }} IN PTR {{ host.name }}
|
||||||
|
{% endfor %}
|
@ -1,6 +1,7 @@
|
|||||||
---
|
---
|
||||||
lan:
|
lan:
|
||||||
network_prefix: 192.168.50
|
network_prefix: 192.168.50
|
||||||
|
network_reverse: 50.168.192
|
||||||
network_name: lan
|
network_name: lan
|
||||||
address: 192.168.50.0
|
address: 192.168.50.0
|
||||||
mask: 255.255.255.0
|
mask: 255.255.255.0
|
||||||
@ -15,29 +16,36 @@ lan:
|
|||||||
- name: bender
|
- name: bender
|
||||||
ip: 3
|
ip: 3
|
||||||
mac: e0:3f:49:6f:03:c2
|
mac: e0:3f:49:6f:03:c2
|
||||||
- name: prusa-new
|
|
||||||
ip: 4
|
|
||||||
mac: b8:27:eb:96:f3:3f
|
|
||||||
mac2: b8:27:eb:c3:a6:6a
|
|
||||||
- name: home-assistant
|
- name: home-assistant
|
||||||
ip: 5
|
ip: 5
|
||||||
mac: dc:a6:32:8b:7b:ab
|
mac: dc:a6:32:8b:7b:ab
|
||||||
mac2: 6a:1b:c8:63:58:7a
|
mac2: 6a:1b:c8:63:58:7a
|
||||||
|
- name: prusa
|
||||||
|
ip: 6
|
||||||
|
mac: b8:27:eb:96:f3:3f
|
||||||
|
mac2: b8:27:eb:c3:a6:6a
|
||||||
|
# - name: rpi3
|
||||||
- name: iron-man
|
- name: iron-man
|
||||||
ip: 7
|
ip: 7
|
||||||
mac: dc:a6:32:03:6d:fa
|
mac: dc:a6:32:03:6d:fa
|
||||||
- name: prusa
|
- name: rpi3a
|
||||||
ip: 8
|
ip: 8
|
||||||
mac: b8:27:eb:ff:2a:86
|
mac: b8:27:eb:ff:2a:86
|
||||||
- name: farnsworth
|
- name: kvm-bender
|
||||||
|
ip: 11
|
||||||
|
mac: dc:a6:32:f6:63:c1
|
||||||
|
- name: hulk
|
||||||
ip: 21
|
ip: 21
|
||||||
|
mac: 24:4b:fe:05:e2:8b
|
||||||
|
- name: farnsworth
|
||||||
|
ip: 22
|
||||||
mac: e0:3f:49:83:e8:dd
|
mac: e0:3f:49:83:e8:dd
|
||||||
- name: ipad
|
|
||||||
ip: 46
|
|
||||||
mac: b8:63:4d:b6:4c:bc
|
|
||||||
- name: android-sgs9
|
- name: android-sgs9
|
||||||
ip: 47
|
ip: 41
|
||||||
mac: 24:18:1d:bc:fe:4f
|
mac: 24:18:1d:bc:fe:4f
|
||||||
|
- name: ipad
|
||||||
|
ip: 42
|
||||||
|
mac: b8:63:4d:b6:4c:bc
|
||||||
- name: node-01
|
- name: node-01
|
||||||
ip: 101
|
ip: 101
|
||||||
mac: dc:a6:32:03:6d:fa
|
mac: dc:a6:32:03:6d:fa
|
||||||
|
Loading…
Reference in New Issue
Block a user