Initial commit of unbound role
Change-Id: I0a5f1517e7912d418b7994e17c856338e07a5ae0
diff --git a/tasks/main.yml b/tasks/main.yml
new file mode 100644
index 0000000..f88267f
--- /dev/null
+++ b/tasks/main.yml
@@ -0,0 +1,32 @@
+---
+# unbound tasks/main.yml
+#
+# SPDX-FileCopyrightText: © 2020 Open Networking Foundation <support@opennetworking.org>
+# SPDX-License-Identifier: Apache-2.0
+
+- name: include OS-specific vars
+ include_vars: "{{ ansible_os_family }}.yml"
+
+- name: include OS-specific tasks
+ include_tasks: "{{ ansible_os_family }}.yml"
+
+- name: Create unbound.conf configuration file from template
+ template:
+ src: "unbound.conf.j2"
+ dest: "{{ unbound_conf_dir }}/unbound.conf"
+ owner: root
+ group: "{{ unbound_groupname }}"
+ mode: 0644
+ backup: true
+ validate: "unbound-checkconf %s"
+ notify:
+ - unbound-restart
+
+- name: Enable and start unbound
+ service:
+ name: "{{ unbound_service }}"
+ enabled: true
+ state: started
+
+- name: Flush handlers as listen addresses can conflict with nsd
+ meta: flush_handlers