/
/
/
1---
2- name: Include OS-specific variables
3 include_vars: "{{ ansible_os_family | lower }}.yml"
4 ignore_errors: true
5
6- name: Log NAS role execution start
7 debug:
8 msg: "Starting NAS role configuration for {{ inventory_hostname }}"
9
10# Package Installation
11- name: Install NAS packages
12 package:
13 name: "{{ nas_install_packages }}"
14 state: present
15 become: true
16 notify: restart nfs services
17
18# Network Bonding Configuration
19- name: Configure network bonding
20 include_tasks: bonding.yml
21 when: nas_network_bonding_enabled | bool
22
23# RAID Configuration (DISABLED - Manual Management)
24# Note: RAID arrays are assumed to be manually configured and mounted
25
26# Storage Management (Subdirectories Only)
27- name: Verify storage mount exists and create subdirectories
28 include_tasks: mounts.yml
29
30# Performance Tuning
31- name: Apply performance tuning
32 include_tasks: performance.yml
33 when: nas_performance_tuning_enabled | bool
34
35# NFS Server Configuration
36- name: Configure NFS server
37 include_tasks: nfs.yml
38 when: nas_nfs_enabled | bool
39
40# Monitoring Setup
41- name: Configure monitoring
42 include_tasks: monitoring.yml
43 when: nas_monitoring_enabled | bool
44
45
46# Backup Integration
47- name: Configure backup integration
48 include_tasks: backup.yml
49 when: nas_backup_integration | bool
50
51- name: Ensure all NAS services are started and enabled
52 systemd:
53 name: "{{ item }}"
54 state: started
55 enabled: true
56 loop: "{{ nas_services }}"
57 become: true
58
59- name: Log NAS role execution completion
60 debug:
61 msg: "NAS role configuration completed successfully for {{ inventory_hostname }}"