summaryrefslogtreecommitdiff
path: root/roles/install_dhcp
diff options
context:
space:
mode:
Diffstat (limited to 'roles/install_dhcp')
-rw-r--r--roles/install_dhcp/tasks/main.yml37
-rw-r--r--roles/install_dhcp/templates/dhcpd.conf.j212
2 files changed, 26 insertions, 23 deletions
diff --git a/roles/install_dhcp/tasks/main.yml b/roles/install_dhcp/tasks/main.yml
index 2e85106..4bcf845 100644
--- a/roles/install_dhcp/tasks/main.yml
+++ b/roles/install_dhcp/tasks/main.yml
@@ -4,24 +4,25 @@
name: dhcp
state: present
-- name: create dhcp file for static ips
- copy:
- content: ''
- dest: /etc/dhcpd.hosts.conf
- force: no
-
-- name: copy fastd-services-api.php
- copy:
- src: fastd-services-api.php
- dest: /etc/fastd-services-api.php
-
-- name: setup cronjob for fastd-services-api
- cron:
- name: fastd-services-api
- minute: '*/10'
- user: root
- cron_file: fastd-api
- job: '/usr/bin/php /etc/fastd-services-api.php'
+#- name: create dhcp file for static ips
+# copy:
+# content: ''
+# dest: /etc/dhcpd.hosts{{ item.name }}.conf
+# force: no
+# with_items: "{{ sites }}"
+#
+#- name: copy fastd-services-api.php
+# copy:
+# src: fastd-services-api.php
+# dest: /etc/fastd-services-api.php
+#
+#- name: setup cronjob for fastd-services-api
+# cron:
+# name: fastd-services-api
+# minute: '*/10'
+# user: root
+# cron_file: fastd-api
+# job: '/usr/bin/php /etc/fastd-services-api.php'
- name: dhcpd.conf
template:
diff --git a/roles/install_dhcp/templates/dhcpd.conf.j2 b/roles/install_dhcp/templates/dhcpd.conf.j2
index e985d1a..42496d6 100644
--- a/roles/install_dhcp/templates/dhcpd.conf.j2
+++ b/roles/install_dhcp/templates/dhcpd.conf.j2
@@ -5,14 +5,16 @@ authoritative;
log-facility local7;
-subnet 10.222.0.0 netmask 255.255.0.0 {
- range {{ dhcp_start }} {{ dhcp_end }};
+{% for site in sites %}
+subnet {{ site.dhcp_subnet }} netmask {{ site.dhcp_netmask }} {
+ range {{ site.dhcp_start }} {{ site.dhcp_end }};
- option routers {{ bat0_ipv4 }};
- option domain-name-servers {{ bat0_ipv4 }};
+ option routers {{ site.bat_ipv4 }};
+ option domain-name-servers {{ site.bat_ipv4 }};
}
+{% endfor %}
subnet {{ ansible_default_ipv4['address'] }} netmask 255.255.255.255 {
}
-include "/etc/dhcpd.hosts.conf";
+#include "/etc/dhcpd.hosts.conf";