Use of node ('localhost') in DSC conf scripts

This topic contains 2 replies, has 3 voices, and was last updated by  Nitin Gupta 2 years ago.

  • Author
  • #40515


    I've been substituting the actual hostnames for nodes in my DSC conf scripts and have been using "node ('localhost')...". Is that ok to do? The reason why is I come from a Chef world where we have a "system baseline" configuration that we apply to every new system we create. I'm used to this idea so I was looking for a way to make my DSC configurations as agnostic as possible...

  • #40524

    Dave Wyatt

    Makes very little difference. You'll wind up with a file named "localhost.mof" (and there may be a reference to "localhost" inside the file's comments or metadata, if I remember right; it's harmless), and you won't be able to push it to a remote system without renaming and/or copying it first, but aside from that, a MOF is a MOF.

  • #40720

    Nitin Gupta

    As long as you are using it locally in Push Mode it is ok. Pull mode has no issues anyway. Azure DSC extension uses very similar approach and always apply the configuration locally.

You must be logged in to reply to this topic.