From 7cbdbfa43c7dee61b7769db83b69bd84be299172 Mon Sep 17 00:00:00 2001 From: Timo Makinen Date: Mon, 30 Aug 2021 18:33:07 +0000 Subject: [PATCH] Add dhcp server to zm hosts --- group_vars/zm.yml | 1 + playbooks/zm.yml | 1 + roles/dhcpd/templates/dhcpd.conf.cam.j2 | 38 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 roles/dhcpd/templates/dhcpd.conf.cam.j2 diff --git a/group_vars/zm.yml b/group_vars/zm.yml index 955181d..d5eac14 100644 --- a/group_vars/zm.yml +++ b/group_vars/zm.yml @@ -10,6 +10,7 @@ network_vip_interfaces: pass: "{{ vip26_pass }}" zm_mysql_host: sqldb02.home.foo.sh +dhcpd_template: dhcpd.conf.cam.j2 firewall_in: - {proto: tcp, port: 22, from: [172.20.20.0/22]} diff --git a/playbooks/zm.yml b/playbooks/zm.yml index 899da59..a12f103 100644 --- a/playbooks/zm.yml +++ b/playbooks/zm.yml @@ -22,6 +22,7 @@ roles: - base + - dhcpd - mod_auth_gssapi - role: kerberos/keytab keytab: /etc/httpd/httpd.keytab diff --git a/roles/dhcpd/templates/dhcpd.conf.cam.j2 b/roles/dhcpd/templates/dhcpd.conf.cam.j2 new file mode 100644 index 0000000..edddc1a --- /dev/null +++ b/roles/dhcpd/templates/dhcpd.conf.cam.j2 @@ -0,0 +1,38 @@ + +authorative; +ddns-update-style none; + +# logging +on commit { + log(info, + concat("Client ", + binary-to-ascii(16, 8, ":", substring(hardware, 1, 6)), + " requests ", + binary-to-ascii(16, 8, ":", option dhcp-parameter-request-list), + " - ", + pick-first-value(option vendor-class-identifier, "no vendor-id"), + " - ", + pick-first-value(option user-class, "no user-class")) + ); +} + +shared-network CAMNET { + + subnet 172.20.26.0 netmask 255.255.255.0 { + default-lease-time 86400; + max-lease-time 604800; + option subnet-mask 255.255.255.0; + option broadcast-address 172.20.26.255; + + option domain-name "cam.foo.sh"; + option domain-name-servers 172.20.26.1, 172.20.26.2, 172.20.26.3; + use-host-decl-names on; + } + + host ipcam01.cam.foo.sh { + option host-name "ipcam01.cam.foo.sh"; + hardware ethernet ec:71:db:6e:bc:0f; + fixed-address 172.20.26.101; + } + +}