Add BI App file server and configuration management for hosts

This commit is contained in:
2026-04-19 08:58:54 +02:00
parent ee04f1ff1a
commit 64b1530cc2
16 changed files with 460 additions and 17 deletions

View File

@@ -0,0 +1,8 @@
---
smb_shares:
- name: k8s
path: 'F:\Shares\k8s'
description: "Kubernetes CSI SMB persistent volume share"
full_access:
- "CWX\\k8s-svc-user"
change_access: []

View File

@@ -0,0 +1,42 @@
---
- name: Install File Server role
ansible.windows.win_feature:
name: FS-FileServer
state: present
include_management_tools: true
register: fs_role
- name: Reboot if File Server role install requires it
ansible.windows.win_reboot:
when: fs_role.reboot_required
- name: Create share directories
ansible.windows.win_file:
path: "{{ item.path }}"
state: directory
loop: "{{ smb_shares }}"
- name: Create SMB shares
ansible.windows.win_share:
name: "{{ item.name }}"
path: "{{ item.path }}"
description: "{{ item.description | default('') }}"
full: "{{ item.full_access | default([]) | join(',') or omit }}"
change: "{{ item.change_access | default([]) | join(',') or omit }}"
state: present
loop: "{{ smb_shares }}"
- name: Disable SMB1 protocol
ansible.windows.win_powershell:
script: |
Set-SmbServerConfiguration -EnableSMB1Protocol $false -Force
- name: Open SMB firewall port
community.windows.win_firewall_rule:
name: "File and Printer Sharing (SMB-In)"
localport: 445
action: allow
direction: in
protocol: tcp
state: present
enabled: true