Skip to content

Latest commit

 

History

History
177 lines (142 loc) · 3.64 KB

File metadata and controls

177 lines (142 loc) · 3.64 KB

DSC Resource 'DscTagging'

DscTagging tags DSC nodes with metadata about the current configuration, including version, environment, and module information.

When to use 'DscTagging'

Use this resource when you need to track which DSC configuration version, environment, and role is applied to each node. It stores metadata in registry entries and environment variables, enabling reporting, inventory, and troubleshooting across your managed infrastructure.

Source

DSC Resource

Documentation

Table 1. Attributes of category 'DscTagging'
Parameter Attribute DataType Description Allowed Values

Version

Mandatory

System.Version

DSC configuration version

BuildNumber

Int

Build number of the DSC configuration

Environment

Mandatory

String

DSC environment information

NodeVersion

String

Optional node specific DSC configuration version

NodeRole

String

Role of the node

DisableGitCommitId

Boolean

Disable export of git commit id

  • True

  • False (default)

Layers

String[]

List of used layers (YAML files) for each node

Note

To fill the Layers list each YAML file requires an DscTagging configuration. In these configuration the attribute Layers should be set with the current layer name (e.g. YAML file name). In Datum.yml the merging rules for DscTagging must be specified as deep merge.

Example Datum.yml (Excerpt)
ResolutionPrecedence:
  - AllNodes\$($Node.Environment)\$($Node.NodeName)
  - Environment\$($Node.Environment)
  - Roles\$($Node.Role)
  - Roles\ServerBaseline

lookup_options:
  # merge rules of DscTagging - using Add to identify duplicate module names
  DscTagging:
    merge_hash: deep
  DscTagging\Modules:
    merge_basetype_array: Add
Example of AllNodes\MyComputer.yml (Excerpt)
NodeName:    MyComputer
Environment: Dev
Role:        FileServer
MyVersion:   1.1
Example Environment\Dev.yml (Excerpt)
DscTagging:
  Environment: Dev
  # use Datum.InvokeCommand to get the role name and version of the current node
  NodeRole:    '[x={ $node.Role }=]'
  NodeVersion: '[x={ $node.MyVersion }=]'
  Layers:
    - Environment\Dev
Example Roles\FileServer.yml (Excerpt)
DscTagging:
  Layers:
    - Roles\FileServer
Example Roles\ServerBaseline.yml (Excerpt)
Configurations:
  - DscTagging

DscTagging:
  Version: 0.3.0
  Layers:
    - Roles\ServerBaseline
Example of RSOP MyComputer.yml (Excerpt)
Configurations:
  - DscTagging

DscTagging:
  Version:     0.3.0
  Environment: Dev
  NodeRole:    FileServer
  NodeVersion: 1.1
  Layers:
    - Environment\Dev
    - Roles\FileServer
    - Roles\ServerBaseline