Added podman-host and linode-dyndns roles

This commit is contained in:
David Thurstenson 2022-11-10 23:55:46 -06:00
parent 22e28c76fa
commit 83486be84e
4 changed files with 53 additions and 0 deletions

4
defaults/main.yml Normal file
View File

@ -0,0 +1,4 @@
---
systemd_system_unit_path: /etc/systemd/system
systemd_user_unit_path: /home/{{ username }}/.config/systemd/user

View File

@ -0,0 +1,12 @@
---
image_name: docker.io/kvllsvm/linode-dynamic-dns
image_tag: latest
domain: thurstylark.com
subdomain: example
update_frequency: 900
# Enable become because this container needs to be run in the
# root instance to access host networking
ansible_become: yes
ansible_become_method: sudo

View File

@ -0,0 +1,26 @@
---
- name: Set up linode api key secret
podman_secret:
name: linode_dns_apikey
state: present
skip_existing: yes
data: {{ linode_api_key }}
- name: Create and start linode-dyndns container
podman_container:
name: linode-dyndns_{{ subdomain }}
image: docker.io/kvllsvm/linode-dynamic-dns:latest
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'"

View File

@ -0,0 +1,11 @@
---
# tasks file for podman-host
- name: Ensure podman packages are installed
pacman:
- podman
- podman-dnsname
- fuse-overlayfs
- slirp4netns
become: yes
become_method: sudo