-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancement/versioned config templates (#7)
- Loading branch information
Showing
7 changed files
with
104 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dev | ||
.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# {{ ansible_managed }} | ||
{% if blocky__hosts_dns_enabled -%} | ||
# Added to blocky__custom_dns from inventory due to blocky__hosts_dns_enabled=true | ||
{% for host in groups[blocky__hosts_dns_invenory_group] -%} | ||
{% set fqdn = host + blocky__hosts_dns_domain %} | ||
{% if (hostvars[host]["blocky__hosts_dns_ignore"] is undefined or not hostvars[host]["blocky__hosts_dns_ignore"]) | ||
and fqdn not in blocky__custom_dns | ||
and hostvars[host][blocky__hosts_dns_host_ip_var] is defined | ||
and host != "localhost" %} | ||
{% set _ = blocky__custom_dns.update({ fqdn: hostvars[host][blocky__hosts_dns_host_ip_var] }) -%} | ||
{% else -%} | ||
# Skipping {{ host }} | ||
{% endif -%} | ||
{% endfor -%} | ||
{% endif -%} | ||
|
||
upstreams: | ||
groups: | ||
{{ blocky__upstreams | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
|
||
blocking: | ||
blockTTL: 10s | ||
denylists: | ||
{{ blocky__blocking_blacklists | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
clientGroupsBlock: | ||
{{ blocky__blocking_client_groups_block | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
allowlists: | ||
{{ blocky__blocking_whitelists | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
|
||
ports: | ||
dns: {{ blocky__ports_dns | to_nice_yaml(indent=2) | trim | indent(2) }} | ||
http: {{ blocky__ports_http | to_nice_yaml(indent=2) | trim | indent(2) }} | ||
|
||
logLevel: {{ blocky__log_level | to_yaml }} | ||
|
||
caching: | ||
minTime: 5m | ||
maxTime: 60m | ||
prefetching: true | ||
|
||
customDNS: | ||
customTTL: 60m | ||
filterUnmappedTypes: true | ||
rewrite: | ||
mapping: | ||
{{ blocky__custom_dns | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
|
||
conditional: | ||
fallbackUpstream: false | ||
mapping: | ||
{{ blocky__custom_domain | to_nice_yaml(indent=2) | trim | indent(4) }} | ||
|
||
prometheus: | ||
enable: true | ||
path: /metrics |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
--- | ||
blocky__base: "blocky-{{ blocky__version }}" | ||
|
||
# Mapping of block versions to config templates | ||
# Must be maintained as blocky evolves. min_version and max_version may be defined for the same template. | ||
blocky__config_template_versions: [ | ||
{'max_version': '0.23', 'template': 'config.yaml.up_to_0.23.j2'}, | ||
{'min_version': '0.24', 'template': 'config.yaml.from_0.24.j2'}, | ||
] |