Skip to content

Commit

Permalink
Add FTL-DNS cofiguration support.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
r-pufky committed Jul 31, 2023
1 parent 68f1030 commit 6b9c819
Show file tree
Hide file tree
Showing 8 changed files with 719 additions and 135 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Settings have been throughly documented for usage.

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

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

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

### Ports
All ports and protocols have been defined for the role.

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

pihole_ad_sources:
- id: 1
address: 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'
enabled: true
comment: 'Migrated from /etc/pihole/adlists.list'
- id: 2
address: 'https://adaway.org/hosts.txt'
enabled: true
Expand Down Expand Up @@ -82,6 +90,30 @@ site.yml
- 'r_pufky.pihole'
```
## Versions
**3.x: FTL Configuration Support**
* Add FTL-DNS configuration support.
* Standardize setupvars to YAML datatypes (no existing change required).
* Enable management of default adlist.
Consumers who have set custom FTL settings should ensure they have set these in
*_vars before applying this version. See:
[defaults/ftl.yml](https://github.com/r-pufky/ansible_pihole/blob/main/defaults/main/ftl.yml).
**2.x: RedHat Support**
* Redhat support. This is best-effort support only.
* Conditional forwarding configuration support.
* Added ports.yml usage reference for data consumption.
**1.x: Initial Release**
* Add support for updating pihole installation.
* Add DHCP configuration, CLI domain list management.
* Allow running in check_mode.
* Reconfigure pihole on configuration change (opposed to restart).
* Support for pihole CLI domain whitelist/blacklist management.
## Issues
Create a bug and provide as much information as possible.
Expand Down
114 changes: 114 additions & 0 deletions defaults/main/blocklist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
###############################################################################
# Pi-Hole Adlist Table
###############################################################################
# Define Adlist sources for generating domain blocklists.
#
# pihole_ad_sources:
# - id: int (unique id starting at 1)
# address: str (URL for adlist)
# enabled: bool (enable use)
# comment: str (user comment)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/#adlist-table-adlist

# Pi-Hole currently adds the stevenblack adlist when installing, as ID 1.
pihole_ad_sources:
- id: 1
address: 'https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts'
enabled: true
comment: 'Migrated from /etc/pihole/adlists.list'

###############################################################################
# Pi-Hole Domain Blocklist Table
###############################################################################
# Define domain blocking behavior (whitelist, blacklist).
#
# pihole_domain_blocklists:
# - id: int (unique id starting at 1)
# type: int (0 = exact whitelist,
# 1 = exact blacklist,
# 2 = regex whitelist,
# 3 = regex blacklist)
# domain: str (domain)
# enabled: bool (enable use)
# comment: str (user comment)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/#domain-tables-domainlist

pihole_domain_blocklists: []

###############################################################################
# Pi-Hole Clients Table
###############################################################################
# Define Pi-Hole clients.
#
# pihole_clients:
# - id: int (unique id starting at 1)
# ip: str (IPv4,IPv6,CIDR)
# comment: str (user comment)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/#client-table-client

pihole_clients: []

###############################################################################
# Pi-Hole Groups Table
###############################################################################
# Define Pi-Hole group management.
#
# pihole_groups:
# - id: int (unique id starting at 1)
# enabled: bool (enable use)
# name: str (group name)
# description: str (description)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/groups/#group-management

pihole_groups: []

###############################################################################
# Pi-Hole Groups Adlist Table
###############################################################################
# Define Pi-Hole group adlist management.
#
# pihole_ad_groups_blocklist:
# - adlist_id: int (existing adlist ID)
# group_id: int (existing group ID)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/groups/

pihole_ad_groups_blocklist: []

###############################################################################
# Pi-Hole Groups Clients Table
###############################################################################
# Define Pi-Hole group clients management.
#
# pihole_ad_groups_blocklist:
# - client_id: int (existing client ID)
# group_id: int (existing group ID)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/groups/

pihole_client_groups_blocklist: []

###############################################################################
# Pi-Hole Groups Domain Blocklists Table
###############################################################################
# Define Pi-Hole group domain blocklists management.
#
# pihole_ad_groups_blocklist:
# - domainlist_id: int (existing domain blocklist ID)
# group_id: int (existing group ID)
#
# Reference:
# * https://docs.pi-hole.net/database/gravity/groups/

pihole_domain_groups_blocklist: []
Loading

0 comments on commit 6b9c819

Please sign in to comment.