ddclient/tasks/docker.yml
2023-03-12 20:49:31 +03:00

34 lines
1.1 KiB
YAML

---
- name: Create configuration dir for {{ ddclient_namespace }}
file:
name: "/opt/{{ ddclient_namespace }}"
state: directory
- name: Copy ddclient configuration for {{ ddclient_namespace }}
copy:
dest: "/opt/{{ ddclient_namespace }}/ddclient.conf"
content: "{{ ddclient_conf }}"
notify: Restart docker ddclient
- name: Copy Kvps.key for {{ ddclient_namespace }}
copy:
dest: "/opt/{{ ddclient_namespace }}/Kvps.key"
content: "{{ ddclient_tsig_public_key_base64 | b64decode }}"
notify: Restart docker ddclient
- name: Copy Kvps.private for {{ ddclient_namespace }}
copy:
dest: "/opt/{{ ddclient_namespace }}/Kvps.private"
content: "{{ ddclient_tsig_private_key_base64 | b64decode }}"
notify: Restart docker ddclient
- name: Start ddclient in docker for {{ ddclient_namespace }}
docker_container:
name: "{{ ddclient_container_name }}"
image: "{{ ddclient_container_registry }}/{{ ddclient_image_name }}:{{ ddclient_image_tag }}"
network_mode: "{{ ddclient_network_mode }}"
state: started
container_default_behavior: no_defaults
restart_policy: unless-stopped
volumes: "{{ ddclient_volumes }}"