Creating one MOF for many servers

This topic contains 6 replies, has 3 voices, and was last updated by Profile photo of Justin King Justin King 8 months ago.

  • Author
    Posts
  • #37429
    Profile photo of Michael Seto
    Michael Seto
    Participant

    I created a very basic DSC configuration that just enables the 'DSCService' WindowsFeature.

    I set the node to 'localhost'.

    I executed and it produced a localhost MOF file. I tried a Start-DscConfiguration and specified a remote server for -ComputerName and it said the computer-specific MOF file for the remote server __servername__ does not exist.

    With DSC, do you have to create a mof file for each remote server you want to remotely push to? Is there a way to just create one generic MOF file and use it with any remote server?

    Thank you!

  • #37430
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Start-DscConfiguration uses its -computername parameter to look for the actual MOF filename, which is why it's failing. You could just use Copy-Item to create one copy of the MOF for each computer you planned to target.

    It's more just the way Start-DscConfiguration was implemented than a restriction of any kind. In Pull mode, which is what most people are expected to do, you can have just one physical MOF, with multiple machines configured to pull it.

  • #37432
    Profile photo of Michael Seto
    Michael Seto
    Participant

    Don,

    So I take it from your reply, that with the push method, I will need a MOF for each destination node, sadly. I also am taking away that it is not the case for the pull method (which most people do).

    Thanks

  • #37434
    Profile photo of Don Jones
    Don Jones
    Keymaster

    Yeah, more or less. I mean, there's some hacky stuff you can do, but end of the day Start-DscConfiguration really wants a 1:1 correlation.

  • #37442
    Profile photo of Michael Seto
    Michael Seto
    Participant

    Don,

    When using the 'push' scenario, do the modules (such as one downloaded like xSharePoint) need to exist at the destination node as well?

  • #37443
    Profile photo of Justin King
    Justin King
    Participant

    You can "cheat" by running it locally so you don't end up using the -computername command. basically write a little wrapper function that copies the mof out then executes the Start-DSCConfiguration locally on that host.

    Shouldn't take too long to write.

  • #37445
    Profile photo of Justin King
    Justin King
    Participant

    All modules (declared in the mof) always need to be present on the target node. During a push scenario, v4 will require you to copy them over, but you can setup a repo in v5 that will work. Both v4 and v5 will let you use a centralized repo in pull mode.

    Good article (not my own) on it here: http://nanalakshmanan.com/blog/Push-Config-Pull-Module/

    EDIT: I edit because my typing sucks

You must be logged in to reply to this topic.