DSC
DSC copied to clipboard
Self-contained configuration and resources package
Summary of the new feature / enhancement
It may be useful to have a zip package format that defines how to have a self-contained configuration and resources making it easier to deploy configuration without installing resources onto each node.
Proposed technical implementation details (optional)
The zip would contain its own manifest defining the root configuration file (as it may include other configs). Resources would be, by default, constrained to those found in the zip and also ones included with DSC (within the DSC home folder). Optionally, DSC_RESOURCE_PATH can be defined within the manifest. Also have a way to catalog sign the package that is cross-platform compatible which would include hashes of the configs and resources.
+1
Isn't this want Machine Configuration Packages are already doing - would be great if it was aligned with that.
The existing machine configuration implementation is built around processing the MOF files representing PSDSC configurations - if DSCv3 supports resolving a configuration and its resources into an archive, machine configuration would be able to leverage that artifact instead of redesigning their implementation to operate on v3 configuration documents.
This functionality is also very useful for test scenarios.
My initial thoughts:
- We name the package with the extension
.dscpkg(pronounced "DSC package") and use thezipformat. - The
.dscpkgis passed todsc.exethe same as a configuration file:dsc config get foo.dscpkg - The root of the
dscpkgcontains a single file with the extension of.dscpkg.yaml,.dscpkg.yml, or.dscpkg.json- If more than one file with any of these extensions is found in the root, an error is returned
- The contents of the
dscpkgmanifest has:$schemapointing to the schema and version of the package manifest- Optional
metadataproperty which the author can put whatever they want and isn't used by DSC like: description, author, copyright, license, etc... (it probably makes sense to recommend some standard metadata properties if we expect these packages to be shared) - Required
resourcePathwhich takes an array of strings to relative paths within the zip to search for resources- Any path that resolves outside of the zip is an error
- Optional
allowCoreResources(not sure ifCore,Builtin, or something else describes this better) that is a boolean whentruewill include thedsc.exehome to search for resources (this is where thegroup, etc... resources reside). Default isfalseif not specified. - Required
configurationFilewhich is a resolved as a relative path within the zip to a YAML or JSON file that is used as the configuraitonDSC_CONFIG_ROOTis wherever this file resides within the zip- Any path that resolves outside of the zip is an error
- Optional
removePackageenum accepts:onSuccesswhen the operation is successful, thedscpkgis deletedalwaysthe package is always deleted even if it failedneverthe package is never deleted (this is default)
- The zip is unpacked into user temp folder and contents deleted after the operation regardless of success or failure