Skip to content

Commit 6b9c819

Browse files
committed
Add FTL-DNS cofiguration support.
Added: * FTL-DNS configuration is now managed. Changed: * Updated defaults to use YAML datatypes for setupVars.conf. This is backwards compatible with existing configurations. * added global pihole_disable_warning to disable warning pause when applying changes; allowing for consumers time to cancel role application if enabled to set updated configurations. * Separated configuration to three files: main, blocklist, ftl. Most users will Use main; more advanced will use blocklist, and very few will use ftl. * 'insert or ignore' migrated to 'insert or replace'; enabling management of the default blocklist (stevenblack); defaults updated to reflect this change.
1 parent 68f1030 commit 6b9c819

File tree

8 files changed

+719
-135
lines changed

8 files changed

+719
-135
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Settings have been throughly documented for usage.
1111

1212
[defaults/main.yml](https://github.com/r-pufky/ansible_pihole/blob/main/defaults/main/main.yml).
1313

14+
[defaults/blocklist.yml](https://github.com/r-pufky/ansible_pihole/blob/main/defaults/main/blocklist.yml).
15+
16+
[defaults/ftl.yml](https://github.com/r-pufky/ansible_pihole/blob/main/defaults/main/ftl.yml).
17+
1418
### Ports
1519
All ports and protocols have been defined for the role.
1620

@@ -33,6 +37,10 @@ group_vars/pihole/vars/pihole.yml
3337
pihole_webpassword: '{{ vault_pihole_webpassword }}'
3438

3539
pihole_ad_sources:
40+
- id: 1
41+
address: 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'
42+
enabled: true
43+
comment: 'Migrated from /etc/pihole/adlists.list'
3644
- id: 2
3745
address: 'https://adaway.org/hosts.txt'
3846
enabled: true
@@ -82,6 +90,30 @@ site.yml
8290
- 'r_pufky.pihole'
8391
```
8492
93+
## Versions
94+
95+
**3.x: FTL Configuration Support**
96+
* Add FTL-DNS configuration support.
97+
* Standardize setupvars to YAML datatypes (no existing change required).
98+
* Enable management of default adlist.
99+
100+
Consumers who have set custom FTL settings should ensure they have set these in
101+
*_vars before applying this version. See:
102+
103+
[defaults/ftl.yml](https://github.com/r-pufky/ansible_pihole/blob/main/defaults/main/ftl.yml).
104+
105+
**2.x: RedHat Support**
106+
* Redhat support. This is best-effort support only.
107+
* Conditional forwarding configuration support.
108+
* Added ports.yml usage reference for data consumption.
109+
110+
**1.x: Initial Release**
111+
* Add support for updating pihole installation.
112+
* Add DHCP configuration, CLI domain list management.
113+
* Allow running in check_mode.
114+
* Reconfigure pihole on configuration change (opposed to restart).
115+
* Support for pihole CLI domain whitelist/blacklist management.
116+
85117
## Issues
86118
Create a bug and provide as much information as possible.
87119

defaults/main/blocklist.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
---
2+
###############################################################################
3+
# Pi-Hole Adlist Table
4+
###############################################################################
5+
# Define Adlist sources for generating domain blocklists.
6+
#
7+
# pihole_ad_sources:
8+
# - id: int (unique id starting at 1)
9+
# address: str (URL for adlist)
10+
# enabled: bool (enable use)
11+
# comment: str (user comment)
12+
#
13+
# Reference:
14+
# * https://docs.pi-hole.net/database/gravity/#adlist-table-adlist
15+
16+
# Pi-Hole currently adds the stevenblack adlist when installing, as ID 1.
17+
pihole_ad_sources:
18+
- id: 1
19+
address: 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'
20+
enabled: true
21+
comment: 'Migrated from /etc/pihole/adlists.list'
22+
23+
###############################################################################
24+
# Pi-Hole Domain Blocklist Table
25+
###############################################################################
26+
# Define domain blocking behavior (whitelist, blacklist).
27+
#
28+
# pihole_domain_blocklists:
29+
# - id: int (unique id starting at 1)
30+
# type: int (0 = exact whitelist,
31+
# 1 = exact blacklist,
32+
# 2 = regex whitelist,
33+
# 3 = regex blacklist)
34+
# domain: str (domain)
35+
# enabled: bool (enable use)
36+
# comment: str (user comment)
37+
#
38+
# Reference:
39+
# * https://docs.pi-hole.net/database/gravity/#domain-tables-domainlist
40+
41+
pihole_domain_blocklists: []
42+
43+
###############################################################################
44+
# Pi-Hole Clients Table
45+
###############################################################################
46+
# Define Pi-Hole clients.
47+
#
48+
# pihole_clients:
49+
# - id: int (unique id starting at 1)
50+
# ip: str (IPv4,IPv6,CIDR)
51+
# comment: str (user comment)
52+
#
53+
# Reference:
54+
# * https://docs.pi-hole.net/database/gravity/#client-table-client
55+
56+
pihole_clients: []
57+
58+
###############################################################################
59+
# Pi-Hole Groups Table
60+
###############################################################################
61+
# Define Pi-Hole group management.
62+
#
63+
# pihole_groups:
64+
# - id: int (unique id starting at 1)
65+
# enabled: bool (enable use)
66+
# name: str (group name)
67+
# description: str (description)
68+
#
69+
# Reference:
70+
# * https://docs.pi-hole.net/database/gravity/groups/#group-management
71+
72+
pihole_groups: []
73+
74+
###############################################################################
75+
# Pi-Hole Groups Adlist Table
76+
###############################################################################
77+
# Define Pi-Hole group adlist management.
78+
#
79+
# pihole_ad_groups_blocklist:
80+
# - adlist_id: int (existing adlist ID)
81+
# group_id: int (existing group ID)
82+
#
83+
# Reference:
84+
# * https://docs.pi-hole.net/database/gravity/groups/
85+
86+
pihole_ad_groups_blocklist: []
87+
88+
###############################################################################
89+
# Pi-Hole Groups Clients Table
90+
###############################################################################
91+
# Define Pi-Hole group clients management.
92+
#
93+
# pihole_ad_groups_blocklist:
94+
# - client_id: int (existing client ID)
95+
# group_id: int (existing group ID)
96+
#
97+
# Reference:
98+
# * https://docs.pi-hole.net/database/gravity/groups/
99+
100+
pihole_client_groups_blocklist: []
101+
102+
###############################################################################
103+
# Pi-Hole Groups Domain Blocklists Table
104+
###############################################################################
105+
# Define Pi-Hole group domain blocklists management.
106+
#
107+
# pihole_ad_groups_blocklist:
108+
# - domainlist_id: int (existing domain blocklist ID)
109+
# group_id: int (existing group ID)
110+
#
111+
# Reference:
112+
# * https://docs.pi-hole.net/database/gravity/groups/
113+
114+
pihole_domain_groups_blocklist: []

0 commit comments

Comments
 (0)