From f833a31c0747dfea71bf3ad1de7b9803dd5b50a4 Mon Sep 17 00:00:00 2001 From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de> Date: Wed, 23 Aug 2017 18:24:46 +0200 Subject: [PATCH] Enhance readability of dhcp-config --- roles/dhcp-server/tasks/main.yml | 2 +- roles/dhcp-server/templates/dnsmasq.conf | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/roles/dhcp-server/tasks/main.yml b/roles/dhcp-server/tasks/main.yml index a1d2c0a..5b36d14 100644 --- a/roles/dhcp-server/tasks/main.yml +++ b/roles/dhcp-server/tasks/main.yml @@ -31,7 +31,7 @@ - dhcp-server - name: ensure we have a tftp root dir - file: name="{{tftp_root}}" state=directory owner="{{dnsmasq_user}}" group="{{dnsmasq_group}}" mode=0644 + file: name="{{tftp_root}}" state=directory owner="{{dnsmasq_user}}" group="{{dnsmasq_group}}" mode=0755 when: tftp_active tags: - config diff --git a/roles/dhcp-server/templates/dnsmasq.conf b/roles/dhcp-server/templates/dnsmasq.conf index 0ff5afd..e52fed9 100644 --- a/roles/dhcp-server/templates/dnsmasq.conf +++ b/roles/dhcp-server/templates/dnsmasq.conf @@ -1,3 +1,7 @@ +# This file was AUTOMATICALLY generated by ansible +# changing it manually won't last long +# PLEASE change vars/dhcp in the ansible repository instead. + # No DNS function, just dhcp & pxe port=0 @@ -12,13 +16,11 @@ dhcp-range={% if dhcp_range.tag is defined %}set:{{dhcp_range.tag}},{% endif %}{ {% endfor %} {% for dhcp_host in dhcp_fixed_hosts %} -dhcp-host={{dhcp_host.mac}},{{lookup('dig', dhcp_host.name)}} - +dhcp-host={{dhcp_host.mac|upper}},{{lookup('dig', dhcp_host.name)}} # {{dhcp_host.name}} {% endfor %} {% for dhcp_option in dhcp_options %} dhcp-option{% if dhcp_option.force is defined and dhcp_option.force %}-force{% endif %}={% if dhcp_option.tag is defined %}tag:{{dhcp_option.tag}},{% endif %}option:{{dhcp_option.option}},{{dhcp_option.value}} - {% endfor %} # Send options to PXELinux. Note that we need to send the options even -- GitLab