DSC NoNodedata table - list servers in array.

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Arie H Arie H 4 weeks, 1 day ago.

  • Author
    Posts
  • #57403
    Profile photo of Bjørn Roalkvam
    Bjørn Roalkvam
    Participant

    Hi Using server2012R2 and PS 5.

    I have a $ConfigData table for my Configuration.
    In my NoNodeData section is it possible to set array values?
    like so:

    SharePoint = @(
    FrontEndServers = @(vm01,vm02)
    )

    So that when i point to this table in my resourceblock, it will capture both vm01 and vm02?

    The resourceblock looks like this:

            SPDistributedCacheService EnableDistributedCache
            {
                Name                 = "AppFabricCachingService"
                Ensure               = "Present"
                CacheSizeInMB        = 1024
                ServiceAccount       = $ServicePoolManagedCred.UserName
                PsDscRunAsCredential = $SPSetupCred
                CreateFirewallRules  = $true
                DependsOn            = "[AddUrlToLocalIntranet]CAURL"
                ServerProvisionOrder = $ConfigurationData.NonNodeData.SharePoint.FrontEndServers
            } 

    The resource ServerProvisionOrder checks the list from nonodedata to see if Distributed cache has been set up, if not then runs this on the local server. So I was just wondering if my

    SharePoint = @(
    FrontEndServers = @(vm01,vm02)
    )

    would work.

    brgs

    Bjørn

  • #57404
    Profile photo of Arie H
    Arie H
    Participant

    Hi,

    The sharepoint dsc resource your using requires ServerProvisionOrder to be a string.
    I dont think it will accept an array but it would definitely accept:

    FrontEndServers = "vm01,vm02"

    Second thing, though i havent tested this, but i dont know if NonNodeData accepts more then one depth of object.
    What i mean is that:

    $ConfigurationData.NonNodeData.SharePoint.FrontEndServers

    might not be applicable, but:

    $ConfigurationData.NonNodeData.FrontEndServers

    definitly wili, if you also remove the FrontEndServers from within the SharePoint array that is inisde your NonNodeData.

    Personally im not sure putting that variable in NonNodeData is the best way, i would actually set it in the AllNodes section under the
    NodeName = "*" section to be the default, and if you want a specific value for a certain node,
    you just overwrite it in the node configuration itself.

You must be logged in to reply to this topic.