-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-modular.yml
More file actions
97 lines (85 loc) · 2.78 KB
/
Copy pathtest-modular.yml
File metadata and controls
97 lines (85 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Modular KVM Host Setup Test Playbook
# Based on ADR-0002: Ansible Role-Based Modular Architecture
- name: Test Modular Qubinode KVM Host Setup
hosts: all
become: true
gather_facts: true
vars:
# Test configuration
testing_mode: true
cicd_test: true
network_validation_enabled: true
# Role feature toggles
enable_base_config: true
enable_networking: true
enable_legacy_kvmhost: false # Disable until fully refactored
pre_tasks:
- name: Create test user for validation
ansible.builtin.user:
name: test-user
state: present
create_home: true
shell: /bin/bash
system: false
generate_ssh_key: true
groups: wheel
append: true
home: /home/test-user
umask: "0022"
when: testing_mode | default(false)
- name: Load role configuration
ansible.builtin.include_vars:
file: roles/role_config.yml
name: role_config
- name: Display role execution plan
ansible.builtin.debug:
msg: |
Role Execution Plan:
{% for order, role_info in role_config.role_execution_order.items() %}
{{ order }}. {{ role_info.name }} - {{ role_info.description }}
Dependencies: {{ role_info.dependencies | join(', ') if role_info.dependencies else 'None' }}
Tags: {{ role_info.tags | join(', ') }}
{% endfor %}
roles:
# Phase 1: Base system configuration
- role: kvmhost_base
when: enable_base_config | default(true)
tags:
- base
- foundation
# Phase 2: Network configuration
- role: kvmhost_networking
when: enable_networking | default(true)
tags:
- networking
- bridge
# Phase 3: Legacy role (to be decomposed)
- role: kvmhost_setup
when: enable_legacy_kvmhost | default(false)
tags:
- legacy
- kvmhost
# Phase 4: Validation roles
- role: edge_hosts_validate
when: testing_mode | default(false)
tags:
- validation
- edge_hosts
post_tasks:
- name: Validate modular role execution
ansible.builtin.debug:
msg: |
Modular Role Execution Complete:
- Base Configuration: {{ 'COMPLETED' if enable_base_config else 'SKIPPED' }}
- Network Configuration: {{ 'COMPLETED' if enable_networking else 'SKIPPED' }}
- Legacy KVM Setup: {{ 'COMPLETED' if enable_legacy_kvmhost else 'SKIPPED' }}
- Host: {{ inventory_hostname }}
- OS: {{ ansible_distribution }} {{ ansible_distribution_version }}
- name: Create completion marker
ansible.builtin.file:
path: /var/lib/qubinode_modular_setup_complete
state: touch
mode: "0644"
owner: root
group: root
become: true