b126cb96dd
Gitea Branch PR & Ansible Deployment / Check and Create PR (push) Successful in 1m14s
Gitea Branch PR & Ansible Deployment / Ansible Lint (push) Failing after 5m34s
Gitea Branch PR & Ansible Deployment / PR Merge (push) Successful in 15s
Gitea Branch PR & Ansible Deployment / Ansible Config Deployment (push) Failing after 9m35s
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
---
|
|
- name: Deploy Docker Service Configurations
|
|
hosts: rinoa
|
|
vars:
|
|
template_base_path: "{{ playbook_dir }}/app-configs"
|
|
appdata_base_path: "~/.docker/config/appdata"
|
|
|
|
tasks:
|
|
- name: Find all Jinja2 templates
|
|
ansible.builtin.find:
|
|
paths: "{{ template_base_path }}"
|
|
patterns: "*.j2"
|
|
recurse: yes
|
|
register: jinja_templates
|
|
delegate_to: localhost
|
|
run_once: true
|
|
|
|
- name: Ensure target directories exist
|
|
ansible.builtin.file:
|
|
path: "{{ appdata_base_path }}/{{ item.path | regex_replace('^' + template_base_path + '/', '') | regex_replace('\\.j2$', '') | dirname }}"
|
|
state: directory
|
|
mode: '0755'
|
|
loop: "{{ jinja_templates.files }}"
|
|
loop_control:
|
|
label: "{{ item.path }}"
|
|
|
|
- name: Render and deploy templates
|
|
ansible.builtin.template:
|
|
src: "{{ item.path }}"
|
|
dest: "{{ appdata_base_path }}/{{ item.path | regex_replace('^' + template_base_path + '/', '') | regex_replace('\\.j2$', '') }}"
|
|
mode: '0644'
|
|
loop: "{{ jinja_templates.files }}"
|
|
loop_control:
|
|
label: "{{ item.path }}" |