benvin/dhcp_failover #327
@ -1,4 +1,52 @@
|
|||||||
---
|
---
|
||||||
|
hiera_include:
|
||||||
|
- frrouting
|
||||||
|
- profiles::dhcp::server
|
||||||
|
|
||||||
|
# networking
|
||||||
|
anycast_ip: 198.18.19.18
|
||||||
|
systemd::manage_networkd: true
|
||||||
|
systemd::manage_all_network_files: true
|
||||||
|
networking::interfaces:
|
||||||
|
eth0:
|
||||||
|
type: physical
|
||||||
|
forwarding: true
|
||||||
|
dhcp: true
|
||||||
|
anycast0:
|
||||||
|
type: dummy
|
||||||
|
ipaddress: "%{hiera('anycast_ip')}"
|
||||||
|
netmask: 255.255.255.255
|
||||||
|
mtu: 1500
|
||||||
|
|
||||||
|
# frrouting
|
||||||
|
frrouting::ospfd_router_id: "%{facts.networking.ip}"
|
||||||
|
frrouting::ospfd_redistribute:
|
||||||
|
- connected
|
||||||
|
frrouting::ospfd_interfaces:
|
||||||
|
eth0:
|
||||||
|
area: 0.0.0.0
|
||||||
|
anycast0:
|
||||||
|
area: 0.0.0.0
|
||||||
|
frrouting::daemons:
|
||||||
|
ospfd: true
|
||||||
|
|
||||||
|
# additional repos
|
||||||
|
profiles::yum::global::repos:
|
||||||
|
frr-extras:
|
||||||
|
name: frr-extras
|
||||||
|
descr: frr-extras repository
|
||||||
|
target: /etc/yum.repos.d/frr-extras.repo
|
||||||
|
baseurl: https://packagerepo.service.consul/frr/el9/extras-daily/%{facts.os.architecture}/os
|
||||||
|
gpgkey: https://packagerepo.service.consul/frr/el9/extras-daily/%{facts.os.architecture}/os/RPM-GPG-KEY-FRR
|
||||||
|
mirrorlist: absent
|
||||||
|
frr-stable:
|
||||||
|
name: frr-stable
|
||||||
|
descr: frr-stable repository
|
||||||
|
target: /etc/yum.repos.d/frr-stable.repo
|
||||||
|
baseurl: https://packagerepo.service.consul/frr/el9/stable-daily/%{facts.os.architecture}/os
|
||||||
|
gpgkey: https://packagerepo.service.consul/frr/el9/stable-daily/%{facts.os.architecture}/os/RPM-GPG-KEY-FRR
|
||||||
|
mirrorlist: absent
|
||||||
|
|
||||||
profiles::dhcp::server::ntpservers:
|
profiles::dhcp::server::ntpservers:
|
||||||
- ntp01.main.unkin.net
|
- ntp01.main.unkin.net
|
||||||
- ntp02.main.unkin.net
|
- ntp02.main.unkin.net
|
||||||
|
|||||||
@ -8,3 +8,6 @@ vault::disable_mlock: true
|
|||||||
|
|
||||||
# manage jellyfin changes
|
# manage jellyfin changes
|
||||||
profiles::media::jellyfin::data_dir: /shared/apps/jellyfin
|
profiles::media::jellyfin::data_dir: /shared/apps/jellyfin
|
||||||
|
|
||||||
|
# dhcp-server requirements
|
||||||
|
profiles::dhcp::server::empty_local_pool: true
|
||||||
|
|||||||
@ -11,29 +11,35 @@ class profiles::dhcp::server (
|
|||||||
Array[String] $globaloptions = [],
|
Array[String] $globaloptions = [],
|
||||||
Hash $pools = {},
|
Hash $pools = {},
|
||||||
Hash $classes = {},
|
Hash $classes = {},
|
||||||
|
Boolean $empty_local_pool = false
|
||||||
){
|
){
|
||||||
|
|
||||||
if $facts['enc_role'] == 'roles::infra::dhcp::server' {
|
class { 'dhcp':
|
||||||
class { 'dhcp':
|
service_ensure => running,
|
||||||
service_ensure => running,
|
interfaces => $interfaces,
|
||||||
interfaces => $interfaces,
|
ntpservers => $ntpservers,
|
||||||
ntpservers => $ntpservers,
|
default_lease_time => $default_lease_time,
|
||||||
default_lease_time => $default_lease_time,
|
globaloptions => $globaloptions
|
||||||
globaloptions => $globaloptions
|
}
|
||||||
}
|
|
||||||
|
|
||||||
# if pools, import them
|
# if pools, import them
|
||||||
$pools.each | $name, $data | {
|
$pools.each | $name, $data | {
|
||||||
dhcp::pool { $name:
|
dhcp::pool { $name:
|
||||||
* => $data,
|
* => $data,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# if classes, import them
|
# if classes, import them
|
||||||
$classes.each | $name, $data | {
|
$classes.each | $name, $data | {
|
||||||
dhcp::dhcp_class { $name:
|
dhcp::dhcp_class { $name:
|
||||||
* => $data,
|
* => $data,
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if $empty_local_pool {
|
||||||
|
dhcp::pool {'local':
|
||||||
|
network => $facts['networking']['interfaces'][$network_primary_interface]['network'],
|
||||||
|
mask => $facts['networking']['interfaces'][$network_primary_interface]['netmask'],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,5 @@ class roles::infra::dhcp::server {
|
|||||||
}else{
|
}else{
|
||||||
include profiles::defaults
|
include profiles::defaults
|
||||||
include profiles::base
|
include profiles::base
|
||||||
include profiles::dhcp::server
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user