diff --git a/README.md b/README.md index 6f6577c1..a1e6b79e 100644 --- a/README.md +++ b/README.md @@ -21,10 +21,12 @@ just a stock Ubuntu install, some clever Ansible config and a bunch of Docker co * Source control with Gitea * SSL secured external access to some applications via Traefik * A Docker host with Portainer for image and container management +* An automatic dynamic DNS updater if you use Cloudflare to host your domain DNS ### Docker Containers Used * [Airsonic](https://airsonic.github.io/) - catalog and stream music +* [Cloudflare DDNS](https://hub.docker.com/r/joshuaavalon/cloudflare-ddns/) - automatically update Cloudflare with your dynamic IP address * [CouchPotato](https://couchpota.to/) - for downloading and managing movies * [Duplicati](https://www.duplicati.com/) - for backing up your stuff * [Emby](https://emby.media/) - Media streaming and management diff --git a/docs/applications/cloudflare_ddns.md b/docs/applications/cloudflare_ddns.md new file mode 100644 index 00000000..3f2bef57 --- /dev/null +++ b/docs/applications/cloudflare_ddns.md @@ -0,0 +1,15 @@ +# Cloudflare Dynamic DNS Updater + +Homepage: [https://github.com/joshuaavalon/docker-cloudflare](https://github.com/joshuaavalon/docker-cloudflare) +Cloudflare: [https://www.cloudflare.com](https://www.cloudflare.com) + +If you want your Ansible-NAS accessible externally then you'll need a domain name. You'll also need to set a wildcard +host A record to point to your static IP, or enable this container to automatically update Cloudflare with your dynamic IP address. + +## Usage + +Set `cloudflare_ddns_enabled: true` in your `group_vars/all.yml` file. + +## Specific Configuration + +Make sure you set your Cloudflare login, domain and API key details within your `group_vars/all.yml` file. \ No newline at end of file diff --git a/group_vars/all.yml.dist b/group_vars/all.yml.dist index 2c8d3f97..781aed14 100644 --- a/group_vars/all.yml.dist +++ b/group_vars/all.yml.dist @@ -5,8 +5,8 @@ # External Access # Traefik will allow access to certain applications externally. To enable this you'll need a domain name that points to your -# home static IP address, or use a dynamic DNS provider like no-ip. You'll also need to map ports 80 and 443 from your router -# to your ansible-nas server. +# home static IP address, cloudflare with the cloudflare_ddns dynamic DNS container enabled, or use a dynamic DNS provider like no-ip. +# You'll also need to map ports 80 and 443 from your router to your ansible-nas server. traefik_enabled: false # BitTorrent @@ -42,6 +42,7 @@ stats_enabled: false guacamole_enabled: false netdata_enabled: false watchtower_enabled: false +cloudflare_ddns_enabled: false # Backup & Restore duplicati_enabled: false @@ -182,6 +183,24 @@ samba_shares: browsable: yes path: "{{ samba_shares_root }}/photos" +### +### Cloudflare +### +# Cloudflare is a great free DNS option for domains. If you use the cloudflare_ddns container then you'll need to +# set the options below. + +# Your domain name +cloudflare_zone: awesomedomain.com + +# The hostname you want the container to update. You shouldn't need to change this. +cloudflare_host: "*.{{ cloudflare_zone }}" + +# Email address used to register for Cloudflare +cloudflare_email: dave@awesomedomain.com + +# Cloudflare 'Global API Key', can be found on the 'My Profile' page +cloudflare_api_key: abcdeabcdeabcdeabcde1234512345 + ################################################################## ###### You shouldn't need to edit anything below this point ###### ################################################################## diff --git a/nas.yml b/nas.yml index 68bc5f52..5043a79d 100644 --- a/nas.yml +++ b/nas.yml @@ -117,4 +117,8 @@ - import_tasks: tasks/airsonic.yml when: airsonic_enabled - tags: airsonic \ No newline at end of file + tags: airsonic + + - import_tasks: tasks/cloudflare_ddns.yml + when: cloudflare_ddns_enabled + tags: cloudflare_ddns \ No newline at end of file diff --git a/tasks/cloudflare_ddns.yml b/tasks/cloudflare_ddns.yml new file mode 100644 index 00000000..47e9f515 --- /dev/null +++ b/tasks/cloudflare_ddns.yml @@ -0,0 +1,13 @@ +- name: Cloudflare Dynamic DNS Container + docker_container: + name: cloudflare-ddns + image: joshava/cloudflare-ddns:latest + pull: true + env: + ZONE: {{ cloudflare_zone }} + HOST: {{ cloudflare_host }} + EMAIL: {{ cloudflare_email }} + API: {{ cloudflare_api_key }} + restart_policy: unless-stopped + memory: 512mb + diff --git a/tests/test.yml b/tests/test.yml index 9d6dc73e..ad864ed6 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -42,6 +42,7 @@ stats_enabled: false guacamole_enabled: false netdata_enabled: false watchtower_enabled: false +cloudflare_ddns_enabled: false # Backup & Restore duplicati_enabled: false @@ -182,6 +183,24 @@ samba_shares: browsable: yes path: "{{ samba_shares_root }}/photos" +### +### Cloudflare +### +# Cloudflare is a great free DNS option for domains. If you use the cloudflare_ddns container then you'll need to +# set the options below. + +# Your domain name +cloudflare_zone: awesomedomain.com + +# The hostname you want the container to update. You shouldn't need to change this. +cloudflare_host: "*.{{ cloudflare_zone }}" + +# Email address used to register for Cloudflare +cloudflare_email: dave@awesomedomain.com + +# Cloudflare 'Global API Key', can be found on the 'My Profile' page +cloudflare_api_key: abcdeabcdeabcdeabcde1234512345 + ################################################################## ###### You shouldn't need to edit anything below this point ###### ##################################################################