Add basic ansible stuff for management

acme-dns is fully handled by ansible already. All services should be
created by ansible in the end.
This commit is contained in:
Tobias Reisinger 2023-06-13 17:59:15 +02:00
parent 607ad23697
commit 7ff7dfe807
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
16 changed files with 162 additions and 3 deletions
_ansible/roles/acme-dns/tasks

View file

@ -0,0 +1,32 @@
---
- name: Deploy acme-dns
tags: acme-dns
vars:
service_path: "{{ (services_path, 'acme-dns') | path_join }}"
config_path: "{{ (service_path, 'config') | path_join }}"
block:
- name: Create a service directory
ansible.builtin.file:
path: "{{ service_path }}"
state: directory
mode: "0755"
- name: Create a service-config directory
ansible.builtin.file:
path: "{{ config_path }}"
state: directory
mode: "0755"
- name: Template acme-dns docker-compose
ansible.builtin.template:
src: docker-compose.yml.j2
dest: "{{ (service_path, 'docker-compose.yml') | path_join }}"
- name: Template acme-dns config
ansible.builtin.template:
src: config.cfg.j2
dest: "{{ (config_path, 'config.cfg') | path_join }}"
- name: Template acme-dns caddy config
ansible.builtin.template:
src: caddy_site.conf.j2
dest: "{{ (caddy_config_path, service.domain + '.conf') | path_join }}"