mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-28 21:17:21 +00:00
win_dfs role
This commit is contained in:
1 parent
6e13922f9c
commit
6f49293b79
4 files changed
+106
No files matched your search
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- hosts: "meta-variant_file_server"
|
||||||
|
gather_facts: false
|
||||||
|
vars_files:
|
||||||
|
- ../vars/common.yml
|
||||||
|
- ../vars/connection.yml
|
||||||
|
roles:
|
||||||
|
- role: win_dfs
|
||||||
|
tags: win_dfs
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
---
|
||||||
|
- name: Configure dfs
|
||||||
|
tags: configure_dfs
|
||||||
|
block:
|
||||||
|
- name: Configure DFS namespace root
|
||||||
|
win_dsc:
|
||||||
|
resource_name: xDFSNamespaceRoot
|
||||||
|
Ensure: Present
|
||||||
|
Path: \\{{ win_project }}.loc\Study_Data
|
||||||
|
TargetPath: \\{{ win_project }}-fs01\Study_Data_DFS
|
||||||
|
Type: DomainV2
|
||||||
|
PsDscRunAsCredential_username: Administrator
|
||||||
|
PsDscRunAsCredential_password: "{{ ansible_password }}"
|
||||||
|
|
||||||
|
- name: Configure DFS replicated group
|
||||||
|
win_dsc:
|
||||||
|
resource_name: xDFSReplicationGroup
|
||||||
|
Ensure: Present
|
||||||
|
GroupName: "{{ win_project }}_Data"
|
||||||
|
DomainName: "{{ win_project }}.loc"
|
||||||
|
# Testing this:
|
||||||
|
Folders: "Study_Data_DFS"
|
||||||
|
PsDscRunAsCredential_username: Administrator
|
||||||
|
PsDscRunAsCredential_password: "{{ ansible_password }}"
|
||||||
|
Members: "{{ win_project }}-fs01, {{ win_project }}-fs02"
|
||||||
|
|
||||||
|
- name: Configure DFS replication connections
|
||||||
|
win_dsc:
|
||||||
|
resource_name: xDFSReplicationGroupConnection
|
||||||
|
Ensure: Present
|
||||||
|
GroupName: "{{ win_project }}_Data"
|
||||||
|
SourceComputerName: "{{ win_project }}-fs01"
|
||||||
|
DestinationComputerName: "{{ win_project }}-fs02"
|
||||||
|
DomainName: "{{ win_project }}.loc"
|
||||||
|
PsDscRunAsCredential_username: Administrator
|
||||||
|
PsDscRunAsCredential_password: "{{ ansible_password }}"
|
||||||
|
|
||||||
|
- name: Configure DFS replication primary member (FS01) and membership
|
||||||
|
win_dsc:
|
||||||
|
resource_name: xDFSReplicationGroupMembership
|
||||||
|
GroupName: "{{ win_project }}_Data"
|
||||||
|
FolderName: "Study_Data_DFS"
|
||||||
|
ContentPath: S:\
|
||||||
|
ComputerName: "{{ win_project }}-fs01"
|
||||||
|
PrimaryMember: true
|
||||||
|
#StagingPathQuotaInMB: 16384
|
||||||
|
DomainName: "{{ win_project }}.loc"
|
||||||
|
PsDscRunAsCredential_username: Administrator
|
||||||
|
PsDscRunAsCredential_password: "{{ ansible_password }}"
|
||||||
|
|
||||||
|
- name: Configure DFS replication secondary member (FS02) and membership
|
||||||
|
win_dsc:
|
||||||
|
resource_name: xDFSReplicationGroupMembership
|
||||||
|
GroupName: "{{ win_project }}_Data"
|
||||||
|
FolderName: "Study_Data_DFS"
|
||||||
|
ContentPath: S:\
|
||||||
|
ComputerName: "{{ win_project }}-fs02"
|
||||||
|
#StagingPathQuotaInMB: 16384
|
||||||
|
DomainName: "{{ win_project }}.loc"
|
||||||
|
PsDscRunAsCredential_username: Administrator
|
||||||
|
PsDscRunAsCredential_password: "{{ ansible_password }}"
|
||||||
|
when: inventory_hostname in groups['meta-name_fs01']
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
- name: DFS Features
|
||||||
|
tags: dfs_features
|
||||||
|
block:
|
||||||
|
- name: Install DFS features
|
||||||
|
win_feature:
|
||||||
|
name:
|
||||||
|
- FS-DFS-Namespace
|
||||||
|
- FS-DFS-Replication
|
||||||
|
- RSAT-DFS-Mgmt-con
|
||||||
|
state: present
|
||||||
|
inlcude_management_tools: True
|
||||||
|
register: feature_status
|
||||||
|
|
||||||
|
- name: Rebooting Servers post feature installation
|
||||||
|
win_reboot:
|
||||||
|
reboot_timeout_sec: 1200
|
||||||
|
when: feature_status.reboot_required == true
|
||||||
|
|
||||||
|
- name: DFS Features
|
||||||
|
tags: dfs_powershell
|
||||||
|
block:
|
||||||
|
- name: Install NuGet packageprovider (requirement for xDFS DSC module installation)
|
||||||
|
ansible.windows.win_powershell:
|
||||||
|
script: |
|
||||||
|
Find-PackageProvider -Name Nuget -ForceBootstrap -IncludeDependencies -Force
|
||||||
|
|
||||||
|
- name: Install xDFS DSC module
|
||||||
|
win_psmodule:
|
||||||
|
name: xDFS
|
||||||
|
state: Present
|
||||||
|
accept_license: true
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
- import_tasks: features.yml
|
||||||
|
- import_tasks: configure.yml
|
||||||
Reference in new issue
Block a user