new file: files/unbound-pihole.conf new file: files/unbound.conf new file: install-unbound.yaml Initial commit
103 lines
2.1 KiB
YAML
103 lines
2.1 KiB
YAML
---
|
|
- name: Setup unbound for name resolution
|
|
hosts: CentOS
|
|
become: true
|
|
tasks:
|
|
- name: Install unbound
|
|
yum:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "RedHat"
|
|
- name: Install unbound
|
|
dnf:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Fedora"
|
|
- name: Install unbound
|
|
apt:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Debian"
|
|
|
|
- name: Apply caching configuration to use non-Overplay upstream
|
|
copy:
|
|
src: files/unbound.conf
|
|
dest: /etc/unbound/unbound.conf
|
|
|
|
- name: Start and enable the unbound service
|
|
service:
|
|
name: unbound
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Setup unbound for name resolution
|
|
hosts: Overplay
|
|
become: true
|
|
tasks:
|
|
- name: Install unbound
|
|
yum:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "RedHat"
|
|
- name: Install unbound
|
|
dnf:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Fedora"
|
|
- name: Install unbound
|
|
apt:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Debian"
|
|
|
|
- name: Apply caching configuration to use non-Overplay upstream
|
|
copy:
|
|
src: files/unbound-overplay.conf
|
|
dest: /etc/unbound/unbound.conf
|
|
|
|
- name: Start and enable the unbound service
|
|
service:
|
|
name: unbound
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Setup unbound for name resolution
|
|
hosts: pihole
|
|
become: true
|
|
tasks:
|
|
- name: Install unbound
|
|
yum:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "RedHat"
|
|
- name: Install unbound
|
|
dnf:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Fedora"
|
|
- name: Install unbound
|
|
apt:
|
|
name: unbound
|
|
state: present
|
|
when:
|
|
ansible_distribution == "Debian"
|
|
|
|
- name: Apply caching configuration to use non-Overplay upstream
|
|
copy:
|
|
src: files/unbound-pihole.conf
|
|
dest: /etc/unbound/unbound.conf
|
|
|
|
- name: Start and enable the unbound service
|
|
service:
|
|
name: unbound
|
|
state: started
|
|
enabled: true
|