Move host section outside of subnet section, use FQDN
Change-Id: Id96567ea493b06ae8ea2320bd0d7fe76a83b410b
diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml
index ae3ffd0..9deb838 100644
--- a/molecule/default/molecule.yml
+++ b/molecule/default/molecule.yml
@@ -9,11 +9,6 @@
driver:
name: docker
platforms:
- - name: "ubuntu-16.04-priv"
- image: "quay.io/paulfantom/molecule-systemd:ubuntu-16.04"
- privileged: true
- volumes:
- - "/sys/fs/cgroup:/sys/fs/cgroup:ro"
- name: "ubuntu-18.04-priv"
image: "quay.io/paulfantom/molecule-systemd:ubuntu-18.04"
privileged: true
diff --git a/templates/dhcpd.conf.j2 b/templates/dhcpd.conf.j2
index 2ed3420..2a67a37 100644
--- a/templates/dhcpd.conf.j2
+++ b/templates/dhcpd.conf.j2
@@ -31,24 +31,25 @@
{% endif %}
{% if subnet.range is defined %}
range {{ subnet.range | ipaddr('next_usable') }} {{ subnet.range | ipaddr('last_usable') }};
-
{% endif %}
+}
+
{% if subnet.hosts is defined %}
- # hosts
+# hosts for subnet: {{ subnet.dns_search [0] }}
{% for host in subnet.hosts %}
- host {{ host.name }} {
- option host-name "{{ host.name }}";
- fixed-address {{ host.ip_addr }};
- hardware ethernet {{ host.mac_addr | hwaddr('linux') }};
+host {{ host.name }}.{{ subnet.dns_search [0] }} {
+ option host-name "{{ host.name }}";
+ fixed-address {{ host.ip_addr }};
+ hardware ethernet {{ host.mac_addr | hwaddr('linux') }};
{% if host.pxe_filename is defined %}
- filename "{{ host.pxe_filename }}";
+ filename "{{ host.pxe_filename }}";
{% endif %}
{% if host.default_url is defined %}
- option default-url "{{ host.default_url }}";
+ option default-url "{{ host.default_url }}";
{% endif %}
- }
+}
{% endfor %}
{% endif %}
-}
+
{% endfor %}