working v6
This commit is contained in:
commit
77780ff216
11 changed files with 329 additions and 0 deletions
65
tasks/FreeBSD-localunbound.yml
Normal file
65
tasks/FreeBSD-localunbound.yml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
- name: "save dhclients dns and dhcp in a file"
|
||||
lineinfile:
|
||||
path: "/etc/resolvconf.conf"
|
||||
regexp: "^{{ item.name }}"
|
||||
line: "{{ item.name }}={{ item.val }}"
|
||||
become: true
|
||||
loop: "{{ sysctl_setting }}"
|
||||
tags:
|
||||
- configuration
|
||||
vars:
|
||||
sysctl_setting:
|
||||
- name: "resolv_conf"
|
||||
val: "/etc/resolv.conf.dhcp"
|
||||
|
||||
- name: "enable local_unbound"
|
||||
lineinfile:
|
||||
path: "/etc/rc.conf"
|
||||
regexp: "^{{ item.name }}"
|
||||
line: "{{ item.name }}={{ item.val }}"
|
||||
become: true
|
||||
loop: "{{ sysctl_setting }}"
|
||||
tags:
|
||||
- configuration
|
||||
vars:
|
||||
sysctl_setting:
|
||||
- name: "local_unbound_enable"
|
||||
val: "YES"
|
||||
|
||||
- name: manage resolv.conf
|
||||
template:
|
||||
dest: /etc/resolv.conf
|
||||
src: templates/resolv.conf.j2
|
||||
become: true
|
||||
tags:
|
||||
- configuration
|
||||
|
||||
- name: "generate access control"
|
||||
template:
|
||||
dest: "/etc/unbound/conf.d/access_control.conf"
|
||||
src: "templates/access_control.j2"
|
||||
become: true
|
||||
tags:
|
||||
- configuration
|
||||
notify: "restart local_unbound"
|
||||
|
||||
- name: "generate overlay for local dns"
|
||||
template:
|
||||
dest: "/etc/unbound/conf.d/local_resolver.conf"
|
||||
src: "templates/local_resolver.j2"
|
||||
become: true
|
||||
tags:
|
||||
- configuration
|
||||
notify: "restart local_unbound"
|
||||
|
||||
- name: "start local_unbound"
|
||||
service:
|
||||
name: "local_unbound"
|
||||
state: started
|
||||
become: true
|
||||
tags:
|
||||
- service
|
||||
- configuration
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue