From 76e159fca50a4b68be56c8c0861087aabda9cbc6 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Wed, 22 Nov 2017 09:41:55 +0000 Subject: [PATCH] some fixes --- handlers/main.yml | 5 +++++ tasks/configure.yml | 9 +++++++++ templates/knot.conf.j2 | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/handlers/main.yml b/handlers/main.yml index c94f0c7..744b6c6 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -5,3 +5,8 @@ name: knot state: reloaded listen: reload nameserver + +- name: restart knot + service: + name: knot + state: restarted diff --git a/tasks/configure.yml b/tasks/configure.yml index ec183c5..dbc794e 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -5,3 +5,12 @@ src: knot.conf.j2 dest: /etc/knot/knot.conf notify: reload knot + +- name: working directory + file: + path: /var/lib/knot + state: directory + owner: knot + group: knot + recurse: yes + notify: restart knot diff --git a/templates/knot.conf.j2 b/templates/knot.conf.j2 index 607b200..1069f55 100644 --- a/templates/knot.conf.j2 +++ b/templates/knot.conf.j2 @@ -1,6 +1,12 @@ server: +{% if not nameserver_ips is defined%} listen: 0.0.0.0@53 listen: ::@53 +{% else %} +{% for ip in nameserver_ips %} + listen: {{ip|ipaddr('address')}}@53 +{% endfor %} +{% endif %} user: knot:knot log: