NodeName = '*' VS additional key e.g. NonNodeData

Hi,

I have a question, mostly regarding design in DSC ConfigurationData.

If you have configuration which you want to be present on any node, there are two options (which I’m aware of).

Either you could specify a node, in AllNodes with the special notion ‘*’ as the NodeName, and in that block specify the configuration, which should be accessible from all nodes in the configuration. Like this:

@{
    AllNodes = @(
        @{
            NodeName    = '*'
            LogPath     = 'C:\LogPath'     
        }

        @{
            NodeName    = 'Server1'
            Role        = 'Role1'
        }
    )
}

Or you could use an additional key, e.g. NonNodeData, like this:

@{
    AllNodes = @(
        @{
            NodeName    = 'Server1'
            Role        = 'Role1'
        }
    )

    NonNodeData = @{
        LogPath = 'C:\LogPath'
    }
}

Which of the above alternatives should be used and when?

Thanks in advance.

Out of the box (and that’s important), you’re right, those are the 2 most common places to store data generic to multiple nodes.

I’d say the rule of thumbs is that ‘*’ is for data generic to absolutely ALL Nodes (i.e. a domain name in a single domain environment), and the ‘NonNodeData’ (that you can call the way you want) is for grouping data under a named key. So you guessed it, it depends…

If you want to learn more about how to organise configuration data and what kind of problem you will face eventually, look at the following (in order):

Thank you for your answer.

I’ll use, as a general approach, ‘*’ for data that is generic to all nodes and additional keys for grouping of data.
Also, I’ll read up on the topics, from the links of which you have sent me.