fix run --check

This commit is contained in:
Gavrilov Alexy 2016-04-08 15:03:33 +05:00
parent 8053f8c2ab
commit 79d3afccb7
2 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@
register: dhcpd_register_nameservers register: dhcpd_register_nameservers
changed_when: False changed_when: False
when: dhcpd_mode == 'server' when: dhcpd_mode == 'server'
always_run: yes
- name: Convert list of nameservers to Ansible list - name: Convert list of nameservers to Ansible list
set_fact: set_fact:

View File

@ -6,10 +6,10 @@ option domain-search "{{ dhcpd_tpl_domain_search | join('", "') }}";
option dhcp6.domain-search "{{ dhcpd_tpl_domain_search | join('", "') }}"; option dhcp6.domain-search "{{ dhcpd_tpl_domain_search | join('", "') }}";
{% endif %} {% endif %}
{% set dhcpd_tpl_nameservers = [] %}
{% if dhcpd_nameservers|d() and dhcpd_nameservers %} {% if dhcpd_nameservers|d() and dhcpd_nameservers %}
{% set dhcpd_tpl_nameservers = dhcpd_nameservers %} {% set dhcpd_tpl_nameservers = dhcpd_nameservers %}
{% elif dhcpd_runtime_nameservers|d() and dhcpd_runtime_nameservers %} {% elif dhcpd_runtime_nameservers|d() and dhcpd_runtime_nameservers %}
{% set dhcpd_tpl_nameservers = [] %}
{% for server in dhcpd_runtime_nameservers %} {% for server in dhcpd_runtime_nameservers %}
{% if server not in [ '127.0.0.1', '::1' ] %} {% if server not in [ '127.0.0.1', '::1' ] %}
{% set _ = dhcpd_tpl_nameservers.append(server) %} {% set _ = dhcpd_tpl_nameservers.append(server) %}