So, the part you're tripping up on is using the DSC Resource module name
(StorageDsc) for the DSC Resource name (Disk). You can take your existing
DSC Configuration script and turn it directly into a Puppet manifest by
keeping the DSC Resouce names like so:

dsc_disk{ 'GVolume':
  dsc_diskid      => 2
  dsc_driveletter => 'G'
  dsc_size        => 10GB
}

dsc_disk{ 'JVolume':
  dsc_diskid      => 2
  dsc_driveletter => 'J'
  dsc_fslabel     => 'Data'
}

dsc_disk{ 'SVolume':
  dsc_diskid             => 3
  dsc_driveletter        => 'S'
  dsc_size               => 100GB
  dsc_fsformat           => 'ReFS'
  dsc_allocationunitsize => 64KB
}

This uses the same labels as the DSC Configuration script, just moves them
into Puppet syntax places, and adjusts the parameter names to follow the
Puppet dsc module convention.

On Wed, Mar 7, 2018 at 11:38 AM, Alexander Ray <a...@alexray.org> wrote:

> I am trying to write a puppet module to automate configuring the disk
> layout of a certain type of server, using DSC.  A typical example (
> https://github.com/PowerShell/StorageDsc/wiki/Disk) is as follows:
>
> Configuration Example
> {
>     Import-DSCResource -ModuleName StorageDsc
>
>     Node localhost
>     {
>         WaitForDisk Disk2
>         {
>              DiskId = 2
>              RetryIntervalSec = 60
>              RetryCount = 60
>         }
>
>         Disk GVolume
>         {
>              DiskId = 2
>              DriveLetter = 'G'
>              Size = 10GB
>              DependsOn = '[WaitForDisk]Disk2'
>         }
>
>         Disk JVolume
>         {
>              DiskId = 2
>              DriveLetter = 'J'
>              FSLabel = 'Data'
>              DependsOn = '[Disk]GVolume'
>         }
>
>         WaitForDisk Disk3
>         {
>              DiskId = 3
>              RetryIntervalSec = 60
>              RetryCount = 60
>         }
>
>         Disk SVolume
>         {
>              DiskId = 3
>              DriveLetter = 'S'
>              Size = 100GB
>              FSFormat = 'ReFS'
>              AllocationUnitSize = 64KB
>              DependsOn = '[WaitForDisk]Disk3'
>         }
>     }
> }
>
>
> What I'm not sure about is how to handle the equivalent puppet manifest -
> I know WaitFor* is not supported, but the other problem is the duplicate
> resource names:
>
> class myclass {
>   dsc_storagedsc { 'Disk':
>     dsc_name => 'DriveOne',
>     dsc_diskid => 3
>   }
>   dsc_storagedsc { 'Disk':
>     dsc_name => 'DriveTwo',
>     dsc_diskid => 4
>   }
> }
>
> I'm not sure how I would 'require' those in other parts of the manifest.
> Also, puppet doesn't seem to like dsc_storagedsc either, though I can use
> dsc_windowsfeature, reboot, etc.  I also tried dsc_storage.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/puppet-users/f9968e37-bc67-4001-a17a-d6a64c01b647%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/f9968e37-bc67-4001-a17a-d6a64c01b647%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
James Pogran
Senior Software Engineer, Windows
james.pog...@puppet.com | @ender2025 <https://twitter.com/ender2025>
Puppet <https://puppet.com/>. *The shortest path to better software*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CABCjNrULcK-irfdonSeOKq36tYGkhe0kmf7exmaWv8gDebTjNA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to