ansible-nas/roles/route53_ddns/tasks/main.yml
2023-03-10 16:40:33 +01:00

36 lines
1.2 KiB
YAML

---
- name: Start AWS Route53 Dynamic DNS
block:
- name: Create AWS Route53 Dynamic DNS Directories
ansible.builtin.file:
path: "{{ route53_data_directory }}"
state: directory
- name: Generate AWS Route53 Dynamic DNS config file
template:
src: config.yml
dest: "{{ route53_data_directory }}/ddns-route53.yml"
register: template_config
- name: AWS Route53 Dynamic DNS Container
community.docker.docker_container:
container_default_behavior: no_defaults
name: "{{ route53_container_name }}"
image: "{{ route53_image_name }}:{{ route53_image_version }}"
pull: true
env:
SCHEDULE: "{{ route53_schedule | string }}"
volumes:
- "{{ route53_data_directory }}/ddns-route53.yml:/etc/ddns-route53/ddns-route53.yml"
restart_policy: unless-stopped
memory: "{{ route53_memory }}"
recreate: "{{ template_config is changed }}"
when: route53_enabled is true
- name: Stop AWS Route53 Dynamic DNS
block:
- name: Stop AWS Route53 Dynamic DNS
community.docker.docker_container:
name: "{{ route53_container_name }}"
state: absent
when: route53_enabled is false