From 0e1c0a11220a323b461d113c7bf25e84a9fb82dd Mon Sep 17 00:00:00 2001 From: Tobias Wolter Date: Sun, 15 Apr 2018 02:11:25 +0200 Subject: [PATCH] Fix some deprecation warnings - installed is deprecated for 2.9, use present - always_run is deprecated, use check_mode no - remove extra spaces at end of lines --- README.md | 4 ++-- defaults/main.yml | 8 ++++---- tasks/main.yml | 12 ++++++------ templates/99forward_zone.conf.j2 | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 309dee5..0b45b0d 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ unbound_forward_zone: ## Generate entries and reverse from the inventory (need ansible_ssh_host set on all host) ``` # Listen interface -unbound_interfaces: +unbound_interfaces: - 127.0.0.1 - 192.168.0.10 @@ -58,7 +58,7 @@ unbound_forward_zone: ## More complete example (need ansible_ssh_host set on all host) ``` # Listen interface -unbound_interfaces: +unbound_interfaces: - 127.0.0.1 - 192.168.0.10 diff --git a/defaults/main.yml b/defaults/main.yml index d9c1931..ce5aa83 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,7 +13,7 @@ unbound_configuration: unbound_zone_name: "default" unbound_only_zones: false -unbound_interfaces: +unbound_interfaces: - 127.0.0.1 unbound_access_control: @@ -23,7 +23,7 @@ unbound_private_address: - 10.0.0.0/8 - 172.16.0.0/12 - 192.168.0.0/16 - - 169.254.0.0/16 + - 169.254.0.0/16 - "fd00::/8" - "fe80::/10" @@ -40,7 +40,7 @@ unbound_default_local_zone: "static" unbound_inventory_domain_with_reverse: true -unbound_zones: +unbound_zones: - name: "default" unbound_forward_zone_active : true @@ -49,7 +49,7 @@ unbound_forward_zone: - 8.8.4.4 #Google DNS 2 # Package states: installed or latest -unbound_pkg_state: installed +unbound_pkg_state: present # Service states: started or stopped unbound_service_state: started diff --git a/tasks/main.yml b/tasks/main.yml index 72c3259..aca0cb3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,10 +20,10 @@ tags: ["configuration","unbound"] - name: configure add independant config file - template: + template: src={{item}}.j2 dest="/etc/unbound/conf.d/{{item}}" - with_items: + with_items: - 01general.conf - 99forward_zone.conf notify: restart unbound @@ -31,7 +31,7 @@ tags: ["configuration","unbound"] - name: configure unbound zones - template: + template: src=10zone.conf.j2 dest="/etc/unbound/conf.d/10{{item.name}}.conf" with_items: "{{unbound_zones}}" @@ -41,11 +41,11 @@ - name: retreive unbound conf file list shell: /bin/ls /etc/unbound/conf.d/ register: unbound_conf_list - always_run: true + check_mode: no tags: ["configuration","unbound"] - name: configure unbound.conf to include all configuration - template: + template: src=unbound.conf.j2 dest=/etc/unbound/unbound.conf validate="/usr/sbin/unbound-checkconf %s" @@ -53,7 +53,7 @@ tags: ["configuration","unbound"] - name: ensure unbound is started/stopped - service: + service: name=unbound state={{ unbound_service_state }} enabled={{ unbound_service_enabled }} diff --git a/templates/99forward_zone.conf.j2 b/templates/99forward_zone.conf.j2 index c6dc30e..e019bc4 100644 --- a/templates/99forward_zone.conf.j2 +++ b/templates/99forward_zone.conf.j2 @@ -5,5 +5,5 @@ name: "." {% for forward_addr in unbound_forward_zone %} forward-addr: {{forward_addr}} -{% endfor %} +{% endfor %} {% endif %}