2021-01-09 17:54:42 +00:00
|
|
|
---
|
2022-05-23 11:59:39 +00:00
|
|
|
- name: Create configuration dir for {{ ddclient_namespace }}
|
2021-01-09 17:54:42 +00:00
|
|
|
file:
|
2022-05-23 11:59:39 +00:00
|
|
|
name: "/opt/{{ ddclient_namespace }}"
|
2021-01-09 17:54:42 +00:00
|
|
|
state: directory
|
|
|
|
|
2022-05-23 11:59:39 +00:00
|
|
|
- name: Copy ddclient configuration for {{ ddclient_namespace }}
|
2021-01-09 17:54:42 +00:00
|
|
|
copy:
|
2022-05-23 11:59:39 +00:00
|
|
|
dest: "/opt/{{ ddclient_namespace }}/ddclient.conf"
|
2021-01-09 17:54:42 +00:00
|
|
|
content: "{{ ddclient_conf }}"
|
|
|
|
notify: restart docker ddclient
|
|
|
|
|
2022-05-23 11:59:39 +00:00
|
|
|
- name: Copy Kvps.key for {{ ddclient_namespace }}
|
2021-01-09 17:54:42 +00:00
|
|
|
copy:
|
2022-05-23 11:59:39 +00:00
|
|
|
dest: "/opt/{{ ddclient_namespace }}/Kvps.key"
|
2021-01-09 17:54:42 +00:00
|
|
|
content: "{{ ddclient_tsig_public_key_base64 | b64decode }}"
|
|
|
|
notify: restart docker ddclient
|
|
|
|
|
2022-05-23 11:59:39 +00:00
|
|
|
- name: Copy Kvps.private for {{ ddclient_namespace }}
|
2021-01-09 17:54:42 +00:00
|
|
|
copy:
|
2022-05-23 11:59:39 +00:00
|
|
|
dest: "/opt/{{ ddclient_namespace }}/Kvps.private"
|
2021-01-09 17:54:42 +00:00
|
|
|
content: "{{ ddclient_tsig_private_key_base64 | b64decode }}"
|
|
|
|
notify: restart docker ddclient
|
|
|
|
|
2022-05-23 11:59:39 +00:00
|
|
|
- name: Start ddclient in docker for {{ ddclient_namespace }}
|
2021-01-09 17:54:42 +00:00
|
|
|
docker_container:
|
2022-05-23 11:59:39 +00:00
|
|
|
name: "{{ ddclient_container_name }}"
|
|
|
|
image: "{{ ddclient_container_registry }}/{{ ddclient_image_name }}:{{ ddclient_image_tag }}"
|
2021-01-09 17:54:42 +00:00
|
|
|
state: started
|
|
|
|
container_default_behavior: no_defaults
|
|
|
|
restart_policy: unless-stopped
|
|
|
|
volumes:
|
2022-05-23 11:59:39 +00:00
|
|
|
- "/opt/{{ ddclient_namespace }}/ddclient.conf:/config/ddclient.conf"
|
|
|
|
- "/opt/{{ ddclient_namespace }}/Kvps.key:/config/Kvps.key"
|
|
|
|
- "/opt/{{ ddclient_namespace }}/Kvps.private:/config/Kvps.private"
|