Skip to content

Commit c5c3a54

Browse files
authored
Merge pull request #14 from shoddyguard/add_ipset
Add ipset support
2 parents a07b662 + 360df6f commit c5c3a54

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ All notable changes to this project will be documented in this file.
1313
- Expanded acceptance testing slightly
1414
- Adds support for DHCP on IPV4 and IPV6, IPV6 remains untested
1515
- Adds experimental support for TLS/SSL
16+
- Adds basic ipset support
1617

1718
**Bugfixes**
1819
Partially fixed #10 whereby you could not specify port numbers when using IP addresses (eg `127.0.0.1:5353` would fail).
1920
This is marked as partially fixed as it works for IPV4 addresses but not IPV6 addresses at present.
2021
Will require more familiarity with IPV6 before that can be implemented.
2122

2223
**Known Issues**
23-
IPSET still not implemented
2424

2525
### [v0.1.0](https://github.com/shoddyguard/Puppet-Adguard/tree/v0.1.0) (2020-03-21)
2626

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ A Puppet module for installing and managing AdGuard Home
55
# Module description
66
This module will install and configure AdGuard Home on a node, it largely uses the defaults provided by AdGuard Home in a typical installation.
77
This module manages AdGuard by manipulating the `AdGuardHome.yaml` file.
8-
There are some features that are not yet working in this module, see the [Known Limitations](#know-limitations) sections for more information.
98

109
This module has been tested on the following platforms:
1110
- Ubuntu 20.04
@@ -151,7 +150,7 @@ class {'adguard':
151150
```
152151
This will stop Puppet from modifing the configuration file and allow AdGuard to manage the file.
153152

154-
You may also wish to disable configuration file managment if you prefer to use to the WebUI to configure AdGuard, or you wish to use one of the [unsupported features](#unsupported-features).
153+
You may also wish to disable configuration file managment if you prefer to use to the WebUI to configure AdGuard, or you wish to manage AdGuard's configuration manually.
155154

156155
**Note**: *Puppet will create the configuration file if it is missing with the values you have specified in your manifests and/or hiera.*
157156

@@ -160,7 +159,3 @@ If your configuration file has been overwritten Puppet will back it up before ov
160159
## Systemd/Resolvd and AdGuard
161160
By default Resolvd will claim port `53` for `DNSStubListener` meaning AdGuard will fail to start when bound to port 53.
162161
In these cases this module will disable `DNSStubListener` in `/etc/systemd/resolved.conf` which **WILL BREAK** local DNS lookups if AdGuard is ever removed and the setting is not changed back manually.
163-
164-
## Unsupported features
165-
Currently this module does not support:
166-
- ipset

REFERENCE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ The following parameters are available in the `adguard` class:
9999
* [`enable_dnssec`](#enable_dnssec)
100100
* [`edns_client_subnet`](#edns_client_subnet)
101101
* [`max_goroutines`](#max_goroutines)
102+
* [`ipset_rules`](#ipset_rules)
102103
* [`filtering_enabled`](#filtering_enabled)
103104
* [`filters_update_interval`](#filters_update_interval)
104105
* [`parental_enabled`](#parental_enabled)
@@ -483,6 +484,14 @@ Max. number of parallel goroutines for processing incoming requests
483484

484485
Default value: `300`
485486

487+
##### <a name="ipset_rules"></a>`ipset_rules`
488+
489+
Data type: `Optional[Array]`
490+
491+
Set ipset rules
492+
493+
Default value: ``undef``
494+
486495
##### <a name="filtering_enabled"></a>`filtering_enabled`
487496

488497
Data type: `Boolean`

manifests/init.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@
105105
# Please note, that this will be done for clients with public IP addresses only.
106106
# @param max_goroutines
107107
# Max. number of parallel goroutines for processing incoming requests
108+
# @param ipset_rules
109+
# Set ipset rules
108110
# @param filtering_enabled
109111
# Filtering of DNS requests based on filter lists.
110112
# @param filters_update_interval
@@ -240,6 +242,7 @@
240242
Boolean $enable_dnssec = false,
241243
Boolean $edns_client_subnet = false,
242244
Integer $max_goroutines = 300,
245+
Optional[Array] $ipset_rules = undef,
243246
Boolean $filtering_enabled = true,
244247
Integer $filters_update_interval = 24,
245248
Boolean $parental_enabled = false,

templates/AdGuardHome.yaml.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,14 @@ dns:
8383
enable_dnssec: <%= @enable_dnssec %>
8484
edns_client_subnet: <%= @edns_client_subnet %>
8585
max_goroutines: <%= @max_goroutines %>
86+
<% if @ipset_rules -%>
87+
ipset:
88+
<% @ipset_rules.each do |ir| -%>
89+
- <%= ir %>
90+
<% end -%>
91+
<% else -%>
8692
ipset: []
93+
<% end -%>
8794
filtering_enabled: <%= @filtering_enabled %>
8895
filters_update_interval: <%= @filters_update_interval %>
8996
parental_enabled: <%= @parental_enabled %>

0 commit comments

Comments
 (0)