Commit e657ac4c authored by claireporche's avatar claireporche Committed by klafyvel

Deploiement des dhcp sur les machines physiques

parent 80aa7ad2
......@@ -34,18 +34,28 @@ all:
lists:
- dhcp.rez
- dhcp.rezometz.org
federez:
interface: eth2
routers: 10.20.254.254
dns: 80.67.188.188
subnet: 10.20.0.0
subnet_mask: 255.255.0.0
broadcast: 10.20.255.255
pool_begin: 10.20.1.1
pool_end: 10.20.253.254
auto_subnets:
- name: Federez
interface: bond0.20
routers: 10.20.254.254
dns: 80.67.188.188
subnet: 10.20.0.0
subnet_mask: 255.255.0.0
broadcast: 10.20.255.255
pool_begin: 10.20.1.1
pool_end: 10.20.253.254
- name: Prerezotage
interface: bond0.68
routers: 10.68.254.254
dns: 80.67.188.188
subnet: 10.68.0.0
subnet_mask: 255.255.0.0
broadcast: 10.68.255.255
pool_begin: 10.68.0.1
pool_end: 10.68.253.254
subnets:
- name: adherents
interface: eth3
interface: bond0.69
subnet: 10.69.0.0
netmask: 255.255.240.0
broadcast: 10.69.15.255
......@@ -55,7 +65,7 @@ all:
- 10.69.9.128
domain_name: rez
- name: bornes
interface: eth1
interface: bond0.8
subnet: 10.8.0.0
netmask: 255.255.0.0
broadcast: 10.8.255.255
......@@ -64,14 +74,14 @@ all:
- 10.8.0.128
domain_name: rez
hosts:
10.7.0.127:
address: 10.7.0.127
peer_address: 10.7.0.128
primary: true
10.7.0.128:
address: 10.7.0.128
peer_address: 10.7.0.127
10.7.0.54:
address: 10.7.0.54
peer_address: 10.7.0.57
primary: false
10.7.0.57:
address: 10.7.0.57
peer_address: 10.7.0.54
primary: true
gateways:
vars:
re2o_address: hydra.rez
......@@ -99,6 +109,7 @@ all:
router_network_address: 10.3.0.57/24
vlan_7_address: 10.7.0.57/16
vlan_2_address: 192.168.2.3/24
vlan_8_address: 10.8.1.43
vlan_13_address: 193.48.225.3/24
vlan_20_address: 10.20.254.57/16
vlan_66_address: 10.66.0.57/24
......@@ -110,6 +121,7 @@ all:
router_network_address: 10.3.0.54/24
vlan_7_address: 10.7.0.54/16
vlan_2_address: 192.168.2.2/24
vlan_8_address: 10.8.1.12
vlan_13_address: 193.48.225.2/24
vlan_20_address: 10.20.254.54/16
vlan_66_address: 10.66.0.54/24
......@@ -119,7 +131,8 @@ all:
keepalived_priority: 150
ldap_servers:
hosts:
janus.rez:
ldap.rezometz.org:
ldap-ro.rezometz.org:
matrix:
hosts:
belisama.rezometz.org:
......
......@@ -34,6 +34,10 @@ auto bond0.2
iface bond0.2 inet static
address {{ vlan_2_address }}
auto bond0.8
iface bond0.8 inet static
address {{ vlan_8_address }}
auto bond0.13
iface bond0.13 inet static
address {{ vlan_13_address }}
......
......@@ -11,6 +11,11 @@
src: dhcp-failover.conf.j2
dest: /etc/dhcp/dhcp-failover.conf
mode: 0644
- name: Disable IPV6
template:
src: isc-dhcp-server.j2
dest: /etc/default/isc-dhcp-server
mode: 0644
- name: Install iso8601
apt:
name: python3-iso8601
......@@ -34,5 +39,5 @@
cron_file: re2o-services
name: Update dhcp lists
user: root
job: "cd /usr/local/dhcp/ && /usr/bin/python3 /usr/local/dhcp/main.py > /dev/null 2>&1"
job: "cd /usr/local/dhcp/ && /usr/bin/python3 /usr/local/dhcp/main.py > /dev/null 2>&1 && systemctl restart isc-dhcp-server"
......@@ -22,18 +22,20 @@ option smtp-server {{ smtp_server }};
include "/etc/dhcp/dhcp-failover.conf";
#Vlan federez
subnet {{ federez.subnet }} netmask {{ federez.subnet_mask }} {
interface {{ federez.interface }};
option routers {{ federez.routers }};
option domain-name-servers {{ federez.dns }};
option subnet-mask {{ federez.subnet_mask }};
option broadcast-address {{ federez.subnet_mask }};
{% for subnet in auto_subnets %}
# Subnet {{ subnet.name }}
subnet {{ subnet.subnet }} netmask {{ subnet.subnet_mask }} {
interface "{{ subnet.interface }}";
option routers {{ subnet.routers }};
option domain-name-servers {{ subnet.dns }};
option subnet-mask {{ subnet.subnet_mask }};
option broadcast-address {{ subnet.subnet_mask }};
pool {
range {{ federez.pool_begin }} {{ federez.pool_end }};
range {{ subnet.pool_begin }} {{ subnet.pool_end }};
failover peer "dhcp-failover";
}
}
{% endfor %}
{% for list in lists %}
include "/usr/local/dhcp/generated/{{ list }}.list";
......@@ -42,7 +44,7 @@ include "/usr/local/dhcp/generated/{{ list }}.list";
{% for subnet in subnets %}
# Subnet {{ subnet.name }}
subnet {{ subnet.subnet }} netmask {{ subnet.netmask }} {
interface {{ subnet.interface }};
interface "{{ subnet.interface }}";
option subnet-mask {{ subnet.netmask }};
option broadcast-address {{ subnet.broadcast }};
{% if 'routers' in subnet %}
......
# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid
# Additional options to start dhcpd with.
# Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""
# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
# Separate multiple interfaces with spaces, e.g. "eth0 eth1".
INTERFACESv4="{% for subnet in auto_subnets %}{{subnet.interface}} {% endfor %} {% for subnet in subnets %}{{subnet.interface}} {% endfor %}"
INTERFACESv6=""
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment