Refactor services-to-host-mapping and playbooks

This commit is contained in:
Tobias Reisinger 2024-10-03 00:50:21 +02:00
parent 825393bbd3
commit a8e14b53f5
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
9 changed files with 142 additions and 108 deletions

View file

@ -1,6 +1,28 @@
---
- name: Run playbook for node001
import_playbook: node001.yml
- name: Run all roles
hosts: serguzim_net
tasks:
- name: Include common roles
ansible.builtin.include_role:
name: "{{ services_item }}"
apply:
tags: "{{ services_item }}"
tags: always
loop:
- always
- backup
- lego
- caddy
- watchtower
loop_control:
loop_var: services_item
- name: Run playbook for node002
import_playbook: node002.yml
- name: Include service roles
ansible.builtin.include_role:
name: "{{ services_item }}"
apply:
tags: "{{ services_item }}"
tags: always
loop: "{{ all_services | my_service_attributes(host_services) }}"
loop_control:
loop_var: services_item