ansible-nas/roles/cloudflare_ddns/tasks/main.yml

29 lines
885 B
YAML
Raw Normal View History

2021-01-20 10:58:11 +00:00
---
- name: Check for deprecated API key
fail:
msg: "Using a Cloudflare global API key is no longer supported. Please unset cloudflare_api_key and set cloudflare_token"
when: cloudflare_api_key is defined
- name: Create cloudflare Dynamic DNS Directories
file:
path: "{{ cloudflare_data_directory }}"
state: directory
- name: Template Cloudflare Dynamic DNS config.yml with scoped token
template:
src: config.yml
dest: "{{ cloudflare_data_directory }}/config.yml"
register: template_files_result
- name: Cloudflare Dynamic DNS Container
docker_container:
name: cloudflare-ddns
image: joshava/cloudflare-ddns:latest
pull: true
volumes:
- "{{ cloudflare_data_directory }}/config.yml:/app/config.yaml"
restart_policy: unless-stopped
memory: "{{ cloudflare_memory }}"
2021-01-20 10:58:11 +00:00
recreate: "{{ template_files_result is changed }}"