home-server/roles/ddclient_FreeDNS_example/tasks/main.yml

60 lines
1.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
# The home-server project produces a multi-purpose setup using Ansible.
# Copyright © 20182023 Y. Gablin, under the GPL-3.0-or-later license.
# Full licensing information in the LICENSE file, or gnu.org/licences/gpl-3.0.txt if the file is missing.
- name: initialize the ddclient software
include_role:
name: ddclient.inc
- name: prepare to override systemd settings
file:
path: '/etc/systemd/system/ddclient@fdns.service.d'
state: directory
mode: 0755
- name: systemd settings for afraid.org
copy:
content: |
[Service]
CapabilityBoundingSet=CAP_AUDIT_WRITE CAP_SYS_CHROOT
PrivateTmp=yes
PrivateDevices=yes
ProtectSystem=yes
ProtectHome=yes
NoNewPrivileges=yes
dest: '/etc/systemd/system/ddclient@fdns.service.d/secure-{{nickname}}.conf'
mode: 0644
notify:
- restart ddclient@fdns.service
- name: ddclient settings for afraid.org
copy:
content: |
use=web
web=http://checkip.dns.he.net/
ssl=yes
server=freedns.afraid.org
protocol=freedns
login=your_login
password=your_password
your-subdomain.at.afraid.org
dest: /etc/ddclient/fdns.conf
mode: 0644
notify:
- restart ddclient@fdns.service
- name: enable ddclient@fdns.service
systemd:
daemon_reload: true
name: ddclient@fdns.service
enabled: true
### LOCAL COMMIT ⇒ ###
- name: commit local changes
include_role: name=etckeeper.inc allow_duplicates=true tasks_from=local.yml
vars:
msg: ddclient@fdns
### ⇐ LOCAL COMMIT ###
- meta: flush_handlers