2022-11-11 05:55:46 +00:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Set up linode api key secret
|
|
|
|
podman_secret:
|
|
|
|
name: linode_dns_apikey
|
|
|
|
state: present
|
|
|
|
skip_existing: yes
|
|
|
|
data: {{ linode_api_key }}
|
|
|
|
|
2022-11-11 06:07:05 +00:00
|
|
|
- name: Pull linode-dyndns container image
|
|
|
|
podman_image:
|
|
|
|
name: {{ image_name }}
|
|
|
|
pull: yes
|
|
|
|
state: present
|
|
|
|
tag: {{ image_tag }}
|
|
|
|
|
2022-11-11 05:55:46 +00:00
|
|
|
- name: Create and start linode-dyndns container
|
|
|
|
podman_container:
|
|
|
|
name: linode-dyndns_{{ subdomain }}
|
2022-11-11 06:09:26 +00:00
|
|
|
hostname: linode-dyndns_{{ subdomain }}
|
2022-11-11 06:08:09 +00:00
|
|
|
image: "{{ image_name }}:{{ image_tag }}"
|
2022-11-11 05:55:46 +00:00
|
|
|
state: started
|
|
|
|
restart_policy: always
|
|
|
|
network: host
|
|
|
|
secrets:
|
|
|
|
- linode_dns_apikey
|
|
|
|
env:
|
|
|
|
- name: DOMAIN
|
|
|
|
value: {{ domain }}
|
|
|
|
- name: HOST
|
|
|
|
value: {{ subdomain }}
|
|
|
|
- name: FREQUENCY
|
|
|
|
value: {{ update_frequency }}
|
|
|
|
command: "/bin/sh -c 'export TOKEN=$(cat /run/secrets/linode_dns_apikey) && linode-dynamic-dns -s $FREQUENCY'"
|
2022-11-11 06:07:05 +00:00
|
|
|
generate_systemd:
|
|
|
|
path: {{ systemd_system_unit_path }}
|