diff --git a/roles/base/tasks/duckdns.yml b/roles/base/tasks/duckdns.yml deleted file mode 100644 index 09ac975..0000000 --- a/roles/base/tasks/duckdns.yml +++ /dev/null @@ -1,11 +0,0 @@ -- name: Install DuckDNS script - template: - src: duckdns.sh.j2 - dest: /usr/local/bin/update-duckdns - mode: 0700 - -- name: Install DuckDNS cron - cron: - name: Update DuckDNS - minute: "*/5" - job: /usr/local/bin/update-duckdns diff --git a/roles/base/tasks/main.yml b/roles/base/tasks/main.yml index dfc96c8..791bc2b 100644 --- a/roles/base/tasks/main.yml +++ b/roles/base/tasks/main.yml @@ -8,10 +8,6 @@ tags: network when: manage_network -- import_tasks: duckdns.yml - tags: duckdns - when: duckdns is defined - - import_tasks: ddclient.yml tags: ddclient when: ddclient is defined diff --git a/roles/base/templates/duckdns.sh.j2 b/roles/base/templates/duckdns.sh.j2 deleted file mode 100644 index 2ef38f4..0000000 --- a/roles/base/templates/duckdns.sh.j2 +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -domains="{{ duckdns.domains }}" -token="{{ duckdns.token }}" -{% if duckdns.logfile is undefined -%} - log="/var/log/duckdns.log" -{% else -%} - log="{{ duckdns.logfile }}" -{% endif %} - -url="https://www.duckdns.org/update?domains=$domains&token=$token&ip=" - -time=$(date '+%Y%m%d-%H%M%S') -result=$(curl --silent $url) - -if [ "$result" = "OK" ]; then - echo "[$time] OK" >> $log -else - echo "[$time] ERROR: $result" >> $log -fi