Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DynDNS accounts for individual users #59

Merged
merged 270 commits into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
270 commits
Select commit Hold shift + click to select a range
d4a3ee3
fix user home reference
suhancz Oct 15, 2023
1e80772
correct fingerprint variable
suhancz Oct 15, 2023
d6a05b0
fix offlineimap package
suhancz Oct 15, 2023
90333e8
fix name translation
suhancz Oct 15, 2023
c655ab3
fix stdout parsing
suhancz Oct 15, 2023
4f2125e
tag specific tasks
suhancz Oct 15, 2023
7df8d91
fix task dependencies
suhancz Oct 15, 2023
64f4d41
fix task dependencies
suhancz Oct 15, 2023
ee72d34
fix task dependencies
suhancz Oct 15, 2023
f50de5e
fix task dependencies
suhancz Oct 15, 2023
1b32807
fix template variable reference
suhancz Oct 15, 2023
b8c8848
clean up debug symbols
suhancz Oct 15, 2023
b2a137c
fix template logic
suhancz Oct 15, 2023
87890bd
imapsync instead of offlineimap
suhancz Oct 15, 2023
75cfa94
cleanup
suhancz Oct 15, 2023
e6d78d7
the loop needs to be inside the called task file for some reason
suhancz Oct 15, 2023
8b6f224
add tag inside the task file, too
suhancz Oct 15, 2023
023bdc3
fix typo
suhancz Oct 15, 2023
b179c14
move passwords to environment variables
suhancz Oct 15, 2023
8cf61c3
move passwords to environment variables
suhancz Oct 15, 2023
f62d0b5
hide passwords
suhancz Oct 15, 2023
db1c12f
hide passwords
suhancz Oct 16, 2023
1cba0d4
fix VPN config permissions
suhancz Oct 16, 2023
3016f39
Merge branch 'hotfix/wireguard_pool_to_hosts'
suhancz Oct 17, 2023
c9b0ca1
Merge tag 'wireguard_pool_to_hosts' into develop
suhancz Oct 17, 2023
2e9c1a0
Merge branch 'release/2.4'
suhancz Oct 17, 2023
872935a
Merge tag '2.4' into develop
suhancz Oct 17, 2023
4550d71
update empty horde schema to 5.2.23-1
suhancz Oct 18, 2023
2813601
add version info
suhancz Oct 18, 2023
fc3428f
don't import if not necessary
suhancz Oct 18, 2023
71b82b9
add version info
suhancz Oct 18, 2023
00ab53d
use fresh database as "schema"
suhancz Oct 18, 2023
92cc589
proper replace
suhancz Oct 18, 2023
793fa75
update schemas
suhancz Oct 18, 2023
40131d5
enable activesync
suhancz Oct 18, 2023
7cc19e7
update schema
suhancz Oct 18, 2023
14c0b45
reset only if requested
suhancz Oct 18, 2023
0b947ae
clean up
suhancz Oct 18, 2023
2856f04
Merge branch 'bugfix/horde-schema' into develop
suhancz Oct 18, 2023
b1b9c4d
Merge branch 'release/2.4.1'
suhancz Oct 18, 2023
6f4b9a4
Merge tag '2.4.1' into develop
suhancz Oct 18, 2023
45215d5
enable ActiveSync outside of schema init
suhancz Oct 19, 2023
636377d
Merge branch 'release/2.4.2'
suhancz Oct 19, 2023
5f8dece
Merge tag '2.4.2' into develop
suhancz Oct 19, 2023
1d39134
install PHP 8.1
suhancz Oct 21, 2023
093b105
sort out dependencies
suhancz Oct 21, 2023
93bb27a
add more tags for easier maintenance
suhancz Oct 21, 2023
c47d151
add perl-CGI for imapsync
suhancz Oct 22, 2023
fe7937c
only install what we explicitly need
suhancz Oct 22, 2023
b65bc1d
enable COPR only if not enabled yet
suhancz Oct 22, 2023
4b185d9
try horde from Cheese repo
suhancz Oct 24, 2023
db35ef2
enable RPM Fusion
suhancz Oct 24, 2023
c4b7649
back to Remi, use an older version of PowerAdmin
suhancz Oct 24, 2023
c0875f6
use releasever, where possible
suhancz Oct 24, 2023
a60454f
fix ElasticSearch version
suhancz Oct 24, 2023
4efe88b
use latest-and-greatest PowerDNS
suhancz Oct 24, 2023
c365335
fully disable php81
suhancz Oct 24, 2023
16ad908
fix PowerDNS repo keys
suhancz Oct 24, 2023
13981d6
use PowerDNS EL repos
suhancz Oct 24, 2023
5742ecc
fix tags to query repolist
suhancz Oct 24, 2023
503c8e7
disable not-in-use PHP versions
suhancz Oct 24, 2023
21d760b
fix user ID
suhancz Oct 25, 2023
aa599af
recursive dedup
suhancz Oct 26, 2023
3fd65db
cron mail notification
suhancz Oct 26, 2023
e76b7ea
move IMAPDedup password to .cron_secrets file
suhancz Oct 26, 2023
81f67f6
fill the perm_templ table
suhancz Oct 26, 2023
aa62e9c
fix lineinfile pattern match
suhancz Oct 26, 2023
3ef72c6
rectify all zones after each DNS record
suhancz Oct 26, 2023
2b8176f
fix tags
suhancz Oct 26, 2023
c7ab236
Merge branch 'release/2.4.3'
suhancz Oct 26, 2023
b1f12b9
Merge tag '2.4.3' into develop
suhancz Oct 26, 2023
73eefc0
Enable Python linting
suhancz Oct 26, 2023
c1df6e9
use offlineimap instead of Dovecot's built-in sync feature
suhancz Oct 1, 2023
b6d2ab2
fix several bugs when installing from scratch
suhancz Oct 14, 2023
78526a5
fix DB schema
suhancz Oct 15, 2023
055875a
fix offlineimap package
suhancz Oct 15, 2023
5d127af
tag specific tasks
suhancz Oct 15, 2023
a70353b
fix template variable reference
suhancz Oct 15, 2023
90c4ddc
imapsync instead of offlineimap
suhancz Oct 15, 2023
8707305
cleanup
suhancz Oct 15, 2023
9d5f97a
don't import if not necessary
suhancz Oct 18, 2023
8527bbc
update schemas
suhancz Oct 18, 2023
46ccc3d
only install what we explicitly need
suhancz Oct 22, 2023
49b3a51
try horde from Cheese repo
suhancz Oct 24, 2023
e756080
enable RPM Fusion
suhancz Oct 24, 2023
5f9d738
back to Remi, use an older version of PowerAdmin
suhancz Oct 24, 2023
932fbc9
use releasever, where possible
suhancz Oct 24, 2023
6e342c9
use offlineimap instead of Dovecot's built-in sync feature
suhancz Oct 1, 2023
a9a6021
fix several bugs when installing from scratch
suhancz Oct 14, 2023
a59c62f
fix DB schema
suhancz Oct 15, 2023
2b0456e
shell instead of command
suhancz Oct 15, 2023
052aa58
fix user home reference
suhancz Oct 15, 2023
ebc93db
correct fingerprint variable
suhancz Oct 15, 2023
a52bd8d
fix offlineimap package
suhancz Oct 15, 2023
abed1eb
fix name translation
suhancz Oct 15, 2023
c6d5e1d
fix stdout parsing
suhancz Oct 15, 2023
48dabd6
tag specific tasks
suhancz Oct 15, 2023
522539b
fix task dependencies
suhancz Oct 15, 2023
23ed6a4
fix task dependencies
suhancz Oct 15, 2023
5db7103
fix template variable reference
suhancz Oct 15, 2023
e8a9966
clean up debug symbols
suhancz Oct 15, 2023
e7761b8
fix template logic
suhancz Oct 15, 2023
b35933f
imapsync instead of offlineimap
suhancz Oct 15, 2023
4369d8d
cleanup
suhancz Oct 15, 2023
def9ff4
don't import if not necessary
suhancz Oct 18, 2023
5d6bc47
update schemas
suhancz Oct 18, 2023
8df8e23
enable activesync
suhancz Oct 18, 2023
f601269
enable ActiveSync outside of schema init
suhancz Oct 19, 2023
d5403f4
only install what we explicitly need
suhancz Oct 22, 2023
1f437bc
try horde from Cheese repo
suhancz Oct 24, 2023
259583c
enable RPM Fusion
suhancz Oct 24, 2023
73986cb
back to Remi, use an older version of PowerAdmin
suhancz Oct 24, 2023
07bf555
use releasever, where possible
suhancz Oct 24, 2023
dafc4a0
fix ElasticSearch version
suhancz Oct 24, 2023
4bd5622
use offlineimap instead of Dovecot's built-in sync feature
suhancz Oct 1, 2023
ef7aa82
fix several bugs when installing from scratch
suhancz Oct 14, 2023
3bea509
fix DB schema
suhancz Oct 15, 2023
5b284ac
fix offlineimap package
suhancz Oct 15, 2023
507dfc3
tag specific tasks
suhancz Oct 15, 2023
551fbe9
fix template variable reference
suhancz Oct 15, 2023
7fdae75
imapsync instead of offlineimap
suhancz Oct 15, 2023
430f2ee
cleanup
suhancz Oct 15, 2023
079f486
don't import if not necessary
suhancz Oct 18, 2023
1ce2580
update schemas
suhancz Oct 18, 2023
8755c63
only install what we explicitly need
suhancz Oct 22, 2023
06ae040
try horde from Cheese repo
suhancz Oct 24, 2023
4af5374
enable RPM Fusion
suhancz Oct 24, 2023
00e3728
back to Remi, use an older version of PowerAdmin
suhancz Oct 24, 2023
0197063
use releasever, where possible
suhancz Oct 24, 2023
c3d69d0
Merge remote-tracking branch 'origin/develop' into develop
suhancz Oct 26, 2023
b2a0a70
Lint Ansible files
suhancz Oct 26, 2023
40de055
fix ElasticSearch version
suhancz Oct 26, 2023
6f1e682
lint Python only if Python files changed
suhancz Oct 26, 2023
28b5db4
fix path match
suhancz Oct 26, 2023
3b23948
add role name
suhancz Oct 26, 2023
566742d
add namespace
suhancz Oct 26, 2023
ddfbc76
Merge remote-tracking branch 'origin/main' into develop
suhancz Oct 26, 2023
c6823ea
add shellcheck
suhancz Oct 26, 2023
88232fa
fix namespace
suhancz Oct 26, 2023
d3030bb
use Super Linter
suhancz Oct 26, 2023
c45f6ac
use underscore
suhancz Oct 26, 2023
da3c1ae
Merge remote-tracking branch 'origin/main' into develop
suhancz Oct 27, 2023
dfcf6a8
tag cron mails with cron
suhancz Oct 27, 2023
2d4717c
set ANSIBLE_DIRECTORY
suhancz Oct 27, 2023
3632fd5
symlink role to tests
suhancz Oct 27, 2023
7c26d15
fix role symlink
suhancz Oct 27, 2023
dc9dca9
fix typo
suhancz Oct 27, 2023
4d64985
switch systemd to ansible.builtin.systemd_service
suhancz Oct 27, 2023
3066adc
fix Jinja2 spacing
suhancz Oct 27, 2023
dc9b233
use ansible.posix.sysctl instead of sysctl
suhancz Oct 27, 2023
1ac98f6
define ansible.posix dependency
suhancz Oct 27, 2023
820c0da
Merge remote-tracking branch 'origin/main' into develop
suhancz Oct 27, 2023
1fccc7f
Merge remote-tracking branch 'origin/main' into release/2.4.4
suhancz Oct 27, 2023
3a2f1a0
define ansible.posix version
suhancz Oct 27, 2023
4b5a62f
remove duplicate line
suhancz Oct 27, 2023
0515b10
set up requirements
suhancz Oct 27, 2023
489480d
exclude some devskim alerts
suhancz Oct 27, 2023
0cd3b99
modprobe dependencies
suhancz Oct 27, 2023
f8bb88e
community.mysql.mysql_user
suhancz Oct 27, 2023
c47d3d0
community.crypto dependency
suhancz Oct 27, 2023
6aa45a5
use FQCNs
suhancz Oct 27, 2023
aa512f4
use FQCNs
suhancz Oct 27, 2023
fc66848
use FQCNs
suhancz Oct 27, 2023
90d3168
satisfy linter
suhancz Oct 27, 2023
d68a267
fix Jinja2 spacing
suhancz Oct 27, 2023
4ce85f0
fix noqa comments
suhancz Oct 27, 2023
86127d2
set some ansible.builtin. FQCNs
suhancz Oct 27, 2023
5787a12
satisfy linter
suhancz Oct 27, 2023
f2dee15
satisfy linter
suhancz Oct 27, 2023
c9798e5
satisfy linter
suhancz Oct 27, 2023
d431fe8
port is port
suhancz Oct 27, 2023
8b084bb
fix spacing
suhancz Oct 27, 2023
18df188
remove accidental duplicate colons
suhancz Oct 27, 2023
786f7bb
sort out FQCNs
suhancz Oct 27, 2023
fe38460
sort out other linter complaints
suhancz Oct 27, 2023
8926492
satisfy linter
suhancz Oct 27, 2023
57f5ffe
sort out FQCNs
suhancz Oct 27, 2023
5aa9ca5
fix broken YAML
suhancz Oct 27, 2023
50b435d
handle most linter errors
suhancz Oct 27, 2023
cc78983
handle leftover linter errors
suhancz Oct 27, 2023
062f122
handle last linter errors
suhancz Oct 27, 2023
a30a56d
handle last linter error
suhancz Oct 27, 2023
a1e288c
improve spacing
suhancz Oct 27, 2023
f097a86
add linter ignore file
suhancz Oct 27, 2023
b3630b3
Merge remote-tracking branch 'origin/main' into main
suhancz Oct 27, 2023
cf3a324
Merge branch 'release/2.4.4'
suhancz Oct 27, 2023
9f5f00a
Merge tag '2.4.4' into develop
suhancz Oct 27, 2023
8a5686b
Merge remote-tracking branch 'origin/main' into develop
suhancz Oct 27, 2023
62442eb
watch the /etc/wireguard directory for modifications
suhancz Oct 27, 2023
bee4834
Merge remote-tracking branch 'origin/main' into main
suhancz Oct 27, 2023
69b7323
Merge branch 'release/2.4.5'
suhancz Oct 27, 2023
2c33726
Merge tag '2.4.5' into develop
suhancz Oct 27, 2023
36bb1d5
Merge remote-tracking branch 'origin/main' into develop
suhancz Oct 27, 2023
7edcf6a
Merge remote-tracking branch 'origin/main' into main
suhancz Oct 27, 2023
7ace12c
Merge branch 'main' into develop
suhancz Oct 27, 2023
7cf4123
opportunity for separate DynDNS for each user
suhancz Oct 28, 2023
c2537d1
fix changed_when in loops
suhancz Oct 28, 2023
b790deb
fix changed_when in loops
suhancz Oct 28, 2023
6dcc406
don't enforce user ID
suhancz Oct 28, 2023
8940699
fix owner references
suhancz Oct 28, 2023
1073657
make sure directories exist
suhancz Oct 28, 2023
9c830ee
create zones
suhancz Oct 28, 2023
2fd72a6
further fixes
suhancz Oct 28, 2023
66a575a
fix record name
suhancz Oct 28, 2023
4a4f424
no dyndns for the server
suhancz Oct 28, 2023
f62ba02
no need for an internal loop
suhancz Oct 28, 2023
59906a2
when before task
suhancz Oct 28, 2023
b803693
reorganize HTTPD configs
suhancz Oct 28, 2023
e704b27
sort out subdomains
suhancz Oct 28, 2023
2fa7bd9
allow to configure kernel modules
suhancz Oct 28, 2023
c0a4309
sort out dyndns records
suhancz Oct 28, 2023
735157e
sort out generic clients
suhancz Oct 28, 2023
d559d89
follow linter suggestions
suhancz Oct 28, 2023
142fbb6
fix list refernces
suhancz Oct 28, 2023
c9a3710
fix typo
suhancz Oct 28, 2023
9f98c52
follow linter suggestions
suhancz Oct 28, 2023
0bfd1ee
add platform metadata
suhancz Oct 28, 2023
d8bb46f
fix zone creation
suhancz Oct 28, 2023
18f24f7
fix typo
suhancz Oct 28, 2023
f926a16
ignore meta alert
suhancz Oct 28, 2023
ed6e77d
fix root dyndns records
suhancz Oct 28, 2023
c478e26
fix dyndns zones
suhancz Oct 28, 2023
836a18b
update docs
suhancz Oct 29, 2023
90f3c98
sort out dynamic domains
suhancz Oct 29, 2023
8dea4b5
fix dynamic host name
suhancz Oct 29, 2023
d70c3ae
make user zones also primary
suhancz Oct 29, 2023
7356dc9
fix quotes
suhancz Oct 29, 2023
f65226c
fix subzone loop
suhancz Oct 29, 2023
c228cd3
refactor user and password queries
suhancz Oct 29, 2023
9df721f
fix password queries
suhancz Oct 29, 2023
fd91fa1
move loop inside the block
suhancz Oct 29, 2023
a04b276
fix condition
suhancz Oct 29, 2023
8f1319b
fix user zone reference
suhancz Oct 29, 2023
abe23ca
fix user zone reference
suhancz Oct 29, 2023
8550679
fix passwords
suhancz Oct 29, 2023
4658f4a
fix zone anme reference
suhancz Oct 29, 2023
83a839b
refactor for loops
suhancz Oct 29, 2023
6102a18
fix dyndns user zone reference
suhancz Oct 29, 2023
4deed8a
simplify user DynDNS domain permissions setup
suhancz Oct 29, 2023
066cc52
fix dyndns user name reference
suhancz Oct 29, 2023
50bf014
fix user references
suhancz Oct 29, 2023
cd5dc20
fix user and password references
suhancz Oct 29, 2023
4469837
fix admin user reference
suhancz Oct 29, 2023
6d4785f
fix admin user name reference
suhancz Oct 29, 2023
818f30e
fix typo
suhancz Oct 29, 2023
da15b39
explsin strange variable behavior
suhancz Oct 29, 2023
ff74bdf
no bcc for vpn service
suhancz Oct 29, 2023
7fba6ce
Merge branch 'feature/separate-dyndns-accounts-for-each-user' into de…
suhancz Oct 29, 2023
24274f4
Merge branch 'release/2.5'
suhancz Oct 29, 2023
45ad06f
Merge tag '2.5' into develop
suhancz Oct 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint-ignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tasks/ssl.yml schema[tasks] # no idea why the linter complains on this one, the whole thing works
meta/main.yml schema[meta] # the platform EL versin 8 does exist - not sure why the liner complains about it
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sudo: false
addons:
apt:
packages:
- python-pip
- python-pip

install:
# Install ansible
Expand All @@ -26,4 +26,4 @@ script:
- ansible-playbook tests/test.yml -i tests/inventory --syntax-check

notifications:
webhooks: https://galaxy.ansible.com/api/v1/notifications/
webhooks: https://galaxy.ansible.com/api/v1/notifications/
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ Role Variables
aliases:
- [email protected]
- [email protected]
old_imap_mail: # Dovecot imapc configuration values
host
ssl
ssl_verify
port
user
password
sync: yes # this boolean is not a default Dovecot thing. indicates if mailbox should be daily synced after the initial copy
old_imap_mail: # connection info to the old IMAP address to sync
host # hostname or IP address of the remote mail server
user # login user to the remote mail server
password # password to log in to the remote mail server
sync: yes # indicates if mailbox should be daily synced after the initial copy
imap_dedup # boolean if e-mails should be deduplicated daily
vpn: # WireGuard setup - if a user doesn't have VPN info defined, a client with their name will be generated by default
- name: client1 # name metadata to identify the VPN client - this should be unique among all users
privatekey: # WireGuard private key for the client
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
force: true
owner: root
group: root
mode: 0644
mode: u=rw,og=r
- name: Restart systemd-resolved
ansible.builtin.systemd_service:
name: systemd-resolved
Expand Down
4 changes: 3 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in meta/main.yml

View workflow job for this annotation

GitHub Actions / Lint Code Base

schema[meta]

{'name': 'EL', 'versions': 8} is not valid under any of the given schemas

Check warning on line 1 in meta/main.yml

View workflow job for this annotation

GitHub Actions / Lint Code Base

schema[meta]

{'name': 'EL', 'versions': 8} is not valid under any of the given schemas
galaxy_info:
author: Akos Balla
description: Mail server suite on RPM-based distros
Expand Down Expand Up @@ -30,7 +30,9 @@
# To view available platforms and versions (or releases), visit:
# https://galaxy.ansible.com/api/v1/platforms/
#
# platforms:
platforms:
- name: EL
versions: 8
# - name: Fedora
# versions:
# - all
Expand Down
3 changes: 2 additions & 1 deletion tasks/antivirus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
- name: Update SPAMAssassin's signatures
ansible.builtin.command: sa-update -D
register: sa_update
failed_when: "{{ sa_update.rc >= 4 }}"
failed_when: sa_update.rc >= 4
changed_when: sa_update.rc != 0
notify: Restart spamassassin
- name: Enable systemd services
ansible.builtin.systemd_service:
Expand Down
50 changes: 50 additions & 0 deletions tasks/configure_dyndns_subdomain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
- name: Add DynDNS NS records
tags:
- dyndns
- poweradmin
ansible.builtin.include_tasks: add_dns_record.yml
vars:
record:
zone: "{% if dyndns_item | length > 0 %}dyndns.{% endif %}{{ mailserver_domain }}"
name: "{{ wg_configs[dyndns_item]['owner'] | default('dyndns') }}"
ttl: "3600"
type: NS
content: "ns.{{ mailserver_domain }}"
- name: Add DynDNS A records
tags:
- dyndns
- poweradmin
ansible.builtin.include_tasks: add_dns_record.yml
vars:
record:
zone: "{% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['owner'] }}.{% endif %}dyndns.{{ mailserver_domain }}"
name: "{% if dyndns_item | length > 0 %}{{ dyndns_item }}{% else %}@{% endif %}"
ttl: "3600"
type: A
content: "{% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['cidr'].split(', ') | first }}{% else %}{{ ansible_default_ipv4.address }}{% endif %}"
- name: Add DynDNS AAAA records
tags:
- dyndns
- poweradmin
ansible.builtin.include_tasks: add_dns_record.yml
vars:
record:
zone: "{% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['owner'] }}.{% endif %}dyndns.{{ mailserver_domain }}"
name: "{% if dyndns_item | length > 0 %}{{ dyndns_item }}{% else %}@{% endif %}"
ttl: "3600"
type: AAAA
content: "{% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['cidr'].split(', ') | last }}{% else %}{{ ansible_default_ipv6.address }}{% endif %}"
- name: Configure PowerDNS recursor to forward DynDNS domains
tags:
- dyndns
- poweradmin
ansible.builtin.lineinfile:
path: /etc/pdns-recursor/recursor.conf
line: "forward-zones+={% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['owner'] }}.{% endif %}dyndns.{{ mailserver_domain }}=127.0.0.1:5300"
regex: "^forward-zones+={% if dyndns_item | length > 0 %}{{ wg_configs[dyndns_item]['owner'] }}.{% endif %}dyndns.{{ mailserver_domain }}="
state: present
backup: yes
no_log: yes
when: public_dns == "yes"
notify: Restart pdns-recursor
6 changes: 3 additions & 3 deletions tasks/dns_records.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
when: public_dns == "yes"
register: enable_dnssec
ignore_errors: yes
changed_when: enable_dnssec.item.rc == 0
changed_when: enable_dnssec.rc == 0
- name: Fail if the issue is not about DNSSEC being already enabled
ansible.builtin.fail:
msg: "{{ item.stderr }}"
Expand All @@ -63,14 +63,14 @@
ansible.builtin.command: 'pdnsutil list-zone {{ item }}'
register: zone_records
loop: "{{ [mailserver_domain] + custom_domains + ['vpn.' ~ mailserver_domain] + ['dyndns.' ~ mailserver_domain] }}"
changed_when: zone_records.item.rc == 0
changed_when: zone_records.rc == 0
- name: Correct SOA record for all domains
ansible.builtin.command: 'pdnsutil replace-rrset {{ zone_record.item }} @ SOA 3600 "ns.{{ mailserver_domain }} hostmaster\\.{{ zone_record.item }} {{ zone_record.stdout_lines | length }} 10800 3600 604800 3600"'
loop: "{{ zone_records.results }}"
loop_control:
loop_var: zone_record
register: zone_record
changed_when: zone_record.zone_record.rc == 0
changed_when: zone_record.rc == 0
- name: Rectify all zones
ansible.builtin.command: pdnsutil rectify-all-zones
register: rectify_zones
Expand Down
Loading
Loading