One configuration multiple nodes.

Welcome Forums DSC (Desired State Configuration) One configuration multiple nodes.

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

 
Participant
1 year, 6 months ago.

  • Author
    Posts
  • #69561

    Participant
    Points: 21
    Rank: Member

    I'm lost again:(

    I've made a configuration to install IIS on a server. It generated a localhost.mof. I renamed it to IIS.mof. Now I want a lcmconfig that I can push to any node.

    [DSCLocalConfigurationManager()]
    Configuration LCM_Config {

    Node localhost {

    Settings {
    ConfigurationMode = 'ApplyAndAutoCorrect'
    RefreshMode = 'Pull'
    }

    ConfigurationRepositoryWeb PullServer {
    ServerURL = 'https://myserver:8080/PSDSCPullServer.svc'
    AllowUnsecureConnection = $False
    RegistrationKey = '01dd6593-ecfd-4cfc-912c-f88d889c5ba7'
    ConfigurationNames = @($role)
    }...

    I run this, Set-DscLocalConfigurationManager -ComputerName xxx -Path .\LCM_Config\localhost.meta.mof

    Set-DscLocalConfigurationManager : The computer-specific MOF file for computer xxx does not exist
    in the current directory.

  • #69564

    Participant
    Points: 0
    Rank: Member

    Hi

    I don't realy understant what you want.

    Thank's

  • #69571

    Participant
    Points: 0
    Rank: Member

    Hi Dan,

    When running Set-DscLocalConfigurationManager you want to point to the directory where the .meta.mof is located at. When executing the cmdlet it will locate a matching .mof file to the specified computer name.

    Example: 
    ## Incorrect ##
    Set-DscLocalConfigurationManager -ComputerName TestMachine -Path "C:\Temp\DscConfigurations\TestMachine.meta.mof"
    
    ## Correct ## Point to the directory where the .meta.mof exists. 
    Set-DscLocalConfigurationManager -ComputerName TestMachine -Path "C:\Temp\DscConfigurations"
    

    Hope this helps.
    -Michael

  • #69579

    Participant
    Points: 0
    Rank: Member

    Also when creating the .meta.mof file as localhost and then updating the file name to IIS will do you no good. That must be the name of the host you are updating or (I think) the assigned Configuration ID (If you are using Configuration IDs). When a meta.mof file gets created it contains meta data which includes "@TargetNode="".

    Refer to this documentation for help
    https://msdn.microsoft.com/en-us/powershell/dsc/metaconfig

    Good Luck
    -Michael

  • #69610

    Participant
    Points: 21
    Rank: Member

    I think I understand now.

    A localhost.meta.mof cannot be deployed to a remote computer. I need one for each machine as I'm deploying from the pull server itself. Alternatively, I can run the lcmconfiguration as localhost on the destination machine.

  • #69700

    Participant
    Points: 0
    Rank: Member

    Yes. That sounds accurate. I think you got it!

    -Michael

The topic ‘One configuration multiple nodes.’ is closed to new replies.