Configure playbook

This commit is contained in:
Sam A. 2024-10-21 23:37:11 +02:00
parent 83d6fb9c31
commit a5316a80a7
Signed by: samsapti
GPG key ID: CBBBE7371E81C4EA
3 changed files with 31 additions and 11 deletions

View file

@ -14,6 +14,7 @@ varsa
folald
[virtual:children]
monitoring
production
staging
control

View file

@ -229,4 +229,4 @@ services:
services_exclude:
- uptime_kuma
services_include: "{{ services | dict2items | map(attribute='key') | list | community.general.lists_difference(services_exclude) }}"
services_include: "{{ services | dict2items | map(attribute='key') | community.general.lists_difference(services_exclude) }}"

View file

@ -1,15 +1,34 @@
# vim: ft=yaml.ansible
# code: language=ansible
---
- hosts: all
- name: Provision all VMs
hosts: virtual
gather_facts: true
become: true
roles:
- name: vm-common
tags: [base_only]
# - name: zfs
# tags: [zfs]
- name: docker
tags: [docker]
- name: services
tags: [services]
tasks:
- name: Include role 'vm-common'
ansible.builtin.include_role:
name: vm-common
- name: Include role 'docker'
ansible.builtin.include_role:
name: docker
when: vm_type == 'app' or
vm_type == 'uptime'
vm_type == 'runner'
# - name: Include role 'zfs'
# ansible.builtin.include_role:
# name: zfs
# when: vm_type == 'app'
- name: Include role 'services'
ansible.builtin.include_role:
name: services
when: vm_type == 'app' or
vm_type == 'uptime'
# - name: Include role 'jumphost'
# ansible.builtin.include_role:
# name: jumpthost
# when: vm_type == 'control'