From b894959c917dc292aaa89e3a4af5d5b4d960f930 Mon Sep 17 00:00:00 2001 From: Jeltz Date: Sat, 27 Aug 2022 10:37:56 +0200 Subject: [PATCH] dhcpd: add sample playbook --- playbooks/dhcpd.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100755 playbooks/dhcpd.yml diff --git a/playbooks/dhcpd.yml b/playbooks/dhcpd.yml new file mode 100755 index 0000000..4bafd1f --- /dev/null +++ b/playbooks/dhcpd.yml @@ -0,0 +1,63 @@ +#!/usr/bin/env ansible-playbook +--- +- hosts: + - dhcp-1.isp.auro.re + - dhcp-2.isp.auro.re + vars: + dhcpd__omapi_key: + algorithm: hmac-sha512 + secret: 99XuJO0ofX3VAnWWlyixWbQ5YTagPfgxyh14IbLNBb3/JzEklkWopvQdj/PXVYbfb/sRyFJBhLexPag4dLh7PA== + dhcpd__interfaces: + - client-0 + - client-1 + - client-2 + - client-3 + - client-4 + dhcpd__dns_servers: + - 10.128.0.127 + dhcpd__domain_search: + - isp.auro.re + - auro.re + dhcpd__subnets: + - network: 100.64.0.0/27 + routers: + - 100.64.0.1 + start: 100.64.0.4 + end: 100.64.0.30 + domain_name: client-0.isp.auro.re + failover: true + - network: 100.64.0.32/27 + routers: + - 100.64.0.31 + start: 100.64.0.33 + end: 100.64.0.63 + domain_name: client-1.isp.auro.re + failover: true + - network: 100.64.0.64/27 + routers: + - 100.64.0.65 + start: 100.64.0.67 + end: 100.64.0.95 + domain_name: client-2.isp.auro.re + failover: true + - network: 100.64.0.96/27 + routers: + - 100.64.0.97 + start: 100.64.0.99 + end: 100.64.0.127 + domain_name: client-3.isp.auro.re + failover: true + - network: 100.64.0.128/27 + routers: + - 100.64.0.129 + start: 100.64.0.131 + end: 100.64.0.159 + domain_name: client-4.isp.auro.re + failover: true + # FIXME: ugly + dhcpd__failover_primary: "{{ inventory_hostname_short == 'dhcp-1' }}" + dhcpd__failover_address: "{{ '10.128.0.204' if dhcpd__failover_primary else '10.128.0.91' }}" + dhcpd__failover_peer_address: "{{ '10.128.0.91' if dhcpd__failover_primary else '10.128.0.204' }}" + roles: + - dhcpd +...