From 4e6e29697d95afbb4841163a3a5d6c1b5f6efebf Mon Sep 17 00:00:00 2001 From: Maciej Delmanowski Date: Thu, 15 Oct 2015 17:52:19 +0200 Subject: [PATCH] Provide empty list of gateways if none are set --- CHANGES.rst | 5 ++++- defaults/main.yml | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index cce4c12..7fa70bf 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changelog v0.1.1 ------ -*Unreleased* +*Released: 2015-10-15* - Make sure that files specified in ``dhcpd_includes`` list exist before the DHCP server is restarted. [drybjed] @@ -21,6 +21,9 @@ v0.1.1 - Change the way role gathers the list of nameservers to avoid issue with ``sed`` command in shell module. [drybjed] +- Provide empty list of relay servers if default IPv4 gateway is not defined. + [drybjed] + v0.1.0 ------ diff --git a/defaults/main.yml b/defaults/main.yml index f165315..04d38f2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -44,7 +44,9 @@ dhcpd_base_packages_map: # .. envvar:: dhcpd_relay_servers # # List of DHCP servers which should receive the relayed packets -dhcpd_relay_servers: [ '{{ ansible_default_ipv4.gateway }}' ] +dhcpd_relay_servers: [ '{{ ansible_default_ipv4.gateway + if (ansible_default_ipv4.gateway|d()) + else [] }}' ] # .. envvar:: dhcpd_relay_interfaces