mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-28 03:00:23 -07:00
Add Support for CachingMode Setting (#21103)
Add Support for CachingMode Setting
This commit is contained in:
parent
778dc9ad38
commit
7d44b2987e
2 changed files with 19 additions and 2 deletions
|
@ -67,7 +67,7 @@ Function UserSearch
|
||||||
$Searcher.Filter = "userPrincipalName=$($accountName)"
|
$Searcher.Filter = "userPrincipalName=$($accountName)"
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $Searcher.FindOne()
|
$result = $Searcher.FindOne()
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$user = $result.GetDirectoryEntry()
|
$user = $result.GetDirectoryEntry()
|
||||||
|
@ -138,6 +138,8 @@ Try {
|
||||||
$permissionFull = Get-AnsibleParam -obj $params -name "full" -type "str" -default "" | NormalizeAccounts
|
$permissionFull = Get-AnsibleParam -obj $params -name "full" -type "str" -default "" | NormalizeAccounts
|
||||||
$permissionDeny = Get-AnsibleParam -obj $params -name "deny" -type "str" -default "" | NormalizeAccounts
|
$permissionDeny = Get-AnsibleParam -obj $params -name "deny" -type "str" -default "" | NormalizeAccounts
|
||||||
|
|
||||||
|
$cachingMode = Get-Attr $params "caching_mode" "" -validateSet "BranchCache","Documents","Manual","None","Programs", "Unkown"
|
||||||
|
|
||||||
If (-Not (Test-Path -Path $path)) {
|
If (-Not (Test-Path -Path $path)) {
|
||||||
Fail-Json $result "$path directory does not exist on the host"
|
Fail-Json $result "$path directory does not exist on the host"
|
||||||
}
|
}
|
||||||
|
@ -170,6 +172,10 @@ Try {
|
||||||
Set-SmbShare -Force -Name $name -FolderEnumerationMode $folderEnum
|
Set-SmbShare -Force -Name $name -FolderEnumerationMode $folderEnum
|
||||||
$result.changed = $true
|
$result.changed = $true
|
||||||
}
|
}
|
||||||
|
if ($share.CachingMode -ne $cachingMode) {
|
||||||
|
Set-SmbShare -Force -Name $name -CachingMode $cachingMode
|
||||||
|
Set-Attr $result "changed" $true;
|
||||||
|
}
|
||||||
|
|
||||||
# clean permissions that imply others
|
# clean permissions that imply others
|
||||||
ForEach ($user in $permissionFull) {
|
ForEach ($user in $permissionFull) {
|
||||||
|
|
|
@ -84,7 +84,18 @@ options:
|
||||||
- Specify user list that should get no access, regardless of implied access on share, separated by comma.
|
- Specify user list that should get no access, regardless of implied access on share, separated by comma.
|
||||||
required: no
|
required: no
|
||||||
default: none
|
default: none
|
||||||
author: Hans-Joachim Kliemeck (@h0nIg)
|
caching_mode:
|
||||||
|
description:
|
||||||
|
- Set the CachingMode for this share.
|
||||||
|
choices:
|
||||||
|
- BranchCache
|
||||||
|
- Documents
|
||||||
|
- Manual
|
||||||
|
- None
|
||||||
|
- Programs
|
||||||
|
- Unknown
|
||||||
|
required: no
|
||||||
|
author: Hans-Joachim Kliemeck (@h0nIg), David Baumann (@daBONDi)
|
||||||
'''
|
'''
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r'''
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue