add dnsmasq pi server

This commit is contained in:
2024-01-31 12:40:28 -05:00
parent fd0699170f
commit 0266d9499c
10 changed files with 77 additions and 8 deletions

7
dns/README.md Normal file
View File

@@ -0,0 +1,7 @@
# DNS Server
## Install
```bash
ansible-playbook -i ansible/inventory.yaml dns/dns.yaml
```

3
dns/conf.d/dns.conf Normal file
View File

@@ -0,0 +1,3 @@
server=10.1.0.1
cache-size=1000
address=/.reeseapps.com/10.1.203.197

25
dns/dns.yaml Normal file
View File

@@ -0,0 +1,25 @@
- name: Update dnsmasq server
hosts: dns
become: true
become_user: root
become_method: sudo
tasks:
- name: Ensure dnsmasq is installed
ansible.builtin.apt:
pkg:
- dnsmasq
- dnsutils
- name: Copy dns configurations
template:
src: "{{ item }}"
dest: /etc/dnsmasq.d/{{ item | basename }}
owner: root
group: root
mode: '0644'
with_fileglob:
- conf.d/*
- name: Reload dnsmasq service
ansible.builtin.systemd_service:
state: restarted
name: dnsmasq
enabled: true