ansible/roles/ddclient/handlers/main.yml

43 lines
1.4 KiB
YAML
Raw Normal View History

2021-01-09 17:54:42 +00:00
---
- name: start ddclient
systemd:
name: ddclient
state: started
enabled: yes
- name: restart ddclient
systemd:
name: ddclient
state: restarted
enabled: yes
- name: restart docker ddclient
community.general.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
restart: yes
container_default_behavior: no_defaults
detach: true
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"
when: ddclient_container_engine == 'docker'
- name: restart podman ddclient
community.general.docker_container:
name: "{{ ddclient_container_name }}"
hostname: "{{ ddclient_container_name }}"
network: "{{ ddclient_network_mode }}"
image: "{{ ddclient_container_registry }}/{{ ddclient_image_name }}:{{ ddclient_image_tag }}"
state: started
restart: yes
volumes:
- "/opt/{{ ddclient_namespace }}/ddclient.conf:/config/ddclient.conf"
- "/opt/{{ ddclient_namespace }}/Kvps.key:/config/Kvps.key"
- "/opt/{{ ddclient_namespace }}/Kvps.private:/config/Kvps.private"
when: ddclient_container_engine == 'podman'
2021-01-09 17:54:42 +00:00