Closed peterbeck closed 4 years ago
Hi Peter,
Glad you like it :)
From the look of your error it is indeed because you cannot parse puppet language 4.
Use of the for each lambda blocks will work on puppet 3.8 (if you turn on 'future parser') and on 4.x as its baked in at that point.
I don't have any puppet version restrictions in my metadata.json for the module I don't think, I should add some.
This could be adapted to do it without the ability to do for each in puppet dsl, but honestly I didn't want to go back in time and the code would get bloated.
Hi there,
Thanks for the hint with the future parser - did not know about that..
I only have a Server 2008 R2 test environment and as far as I know the 'New-SmbShare' function is only available from Windows 8 / Server 2012. It seems this is a no-go with older versions of windows..
The SMB commands (and several other modules) are specific to Windows 8 and Server 2012.
You can use them from Windows 7 via remoting, but they do not target Windows 7 or Server 2008 R2.
The SMB commands target a new WMI namespace (ROOT/Microsoft/Windows/SMB) that
does not exist on earlier versions of the OS.
Anyway, thanks for your help! Will come back to your module as soon as we have more recent Windows servers to manage and I've switched to the future parser (that also gives me some work to do on some existing modules....)
Cheers Peter
Try installing PowerShell v4 on your 2008 r2, should work
Yes, I did, In fact, PS 5.0 is installed:
PS C:\Users\Administrator> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 0 10586 117
But there is no "New-SmbShare" cmdlet available
Get-Help: Get-Help could not find New-SmbShare....
Will try tomorrow on a Win10 machine, just to ensure.
Hrm, worked ok for me on 2012 r2. This seems to indicate its present on 2012 vanilla too: https://technet.microsoft.com/en-us/library/jj635722(v=wps.630).aspx
Hi karmafeast,
this module is awesome, but I do believe that "each" iterations (in puppet, not templates) are only in most recent puppet versions (I do think puppet 4.4) supported. Maybe you could mention the minimum puppet version in order to use that module in the readme ? I'm on Debian with puppet from the repositories (3.7.2) and this is sadly not supported and fails with
Syntax error at '.'; expected '}' at /etc/puppet/modules/windows_smb/manifests/manage_smb_share.pp:58
Or am I doing something wrong ?
Best Regards Peter