diff options
Diffstat (limited to 'roles/dyndns/client/templates')
-rw-r--r-- | roles/dyndns/client/templates/dyndns.service.j2 | 19 | ||||
-rw-r--r-- | roles/dyndns/client/templates/dyndns.timer.j2 | 8 | ||||
-rw-r--r-- | roles/dyndns/client/templates/ssh_config.j2 | 6 |
3 files changed, 33 insertions, 0 deletions
diff --git a/roles/dyndns/client/templates/dyndns.service.j2 b/roles/dyndns/client/templates/dyndns.service.j2 new file mode 100644 index 00000000..31a430ee --- /dev/null +++ b/roles/dyndns/client/templates/dyndns.service.j2 @@ -0,0 +1,19 @@ +[Unit] +Description=Update dyndns using {{ hostvars[dyndns_server].host_name }}.{{ hostvars[dyndns_server].host_domain }} + +[Service] +Type=oneshot +ExecStart=/usr/bin/ssh {{ hostvars[dyndns_server].host_name }}.{{ hostvars[dyndns_server].host_domain }} {{ dyndns_client_name }} +User=dyndns +Group=dyndns +Nice=19 +CapabilityBoundingSet=CAP_CHOWN CAP_NET_BIND_SERVICE +NoNewPrivileges=yes +PrivateTmp=yes +PrivateDevices=yes +ProtectSystem=strict +ProtectHome=yes +ProtectKernelTunables=yes +ProtectControlGroups=yes +RestrictRealtime=yes +RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 diff --git a/roles/dyndns/client/templates/dyndns.timer.j2 b/roles/dyndns/client/templates/dyndns.timer.j2 new file mode 100644 index 00000000..c5a08c8d --- /dev/null +++ b/roles/dyndns/client/templates/dyndns.timer.j2 @@ -0,0 +1,8 @@ +[Unit] +Description=Trigger dyndns updates + +[Timer] +OnCalendar=*:1/3 + +[Install] +WantedBy=timers.target diff --git a/roles/dyndns/client/templates/ssh_config.j2 b/roles/dyndns/client/templates/ssh_config.j2 new file mode 100644 index 00000000..fd15bc49 --- /dev/null +++ b/roles/dyndns/client/templates/ssh_config.j2 @@ -0,0 +1,6 @@ +Host {{ hostvars[dyndns_server].host_name }}.{{ hostvars[dyndns_server].host_domain }} + Port {{ hostvars[dyndns_server].ansible_port }} + User {{ hostvars[dyndns_server].user | default('dyndns') }} + IdentityFile {{ dyndns_user.ssh_key_file }} + IdentitiesOnly yes + PasswordAuthentication no |