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

Welcome Forums DSC (Desired State Configuration) NodeName = '*' VS additional key e.g. NonNodeData

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
6 months, 3 weeks ago.

  • Author
    Posts
  • #101179

    Participant
    Points: 0
    Rank: Member

    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.

  • #101280

    Participant
    Points: 83
    Rank: Member

    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):
    – Jason Helmick's session from PS Summit: https://www.youtube.com/watch?v=uMB7eYbimxs
    – Missy Januszko's article on the subject: https://www.petri.com/dsc-configuration-data-layout-tips-tricks
    – My blog posts: https://gaelcolas.com/2018/01/29/the-dsc-configuration-data-problem/ & https://gaelcolas.com/2018/02/07/composing-dsc-roles/

    • #101283

      Participant
      Points: 0
      Rank: Member

      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.

The topic ‘NodeName = '*' VS additional key e.g. NonNodeData’ is closed to new replies.