Add BI App file server and configuration management for hosts
This commit is contained in:
@@ -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: []
|
||||
42
configuration/ansible_fs/roles/smb_share/tasks/main.yml
Normal file
42
configuration/ansible_fs/roles/smb_share/tasks/main.yml
Normal 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
|
||||
Reference in New Issue
Block a user