vmware / dscr-for-vmware

The Repository contains Microsoft PowerShell Desired State Configuration (DSC) Resources for managing VC and ESXi settings.
Other
140 stars 41 forks source link

[Feature] Include a 'default' configuration for each resource #203

Open lucdekens opened 5 years ago

lucdekens commented 5 years ago

As discussed in #39 and #101, all resources shall contain a configuration file demonstrating the 'defaults' as taken by vSphere. The 'defaults' are the values taken by vSphere when no explicit values are specified.

Since the 'defaults' may change between vSphere versions, the configuration shall indicate for which vSphere version it contains the 'defaults'.

lucdekens commented 4 years ago

Using this information in the ExportVMHostConfiguration script would seriously lower the number of generated lines.

Just saying :-)

SimeonGerginov commented 4 years ago

Yes I agree and I propose to add each configuration here as a separate comment and then add them to the repository with a single PR. What do you think ?

lucdekens commented 4 years ago

Sounds like a plan.

One aspect to consider before doing that is the relation between defaults and the vSphere version. Some defaults change with the vSphere version.

SimeonGerginov commented 4 years ago

VMHostNtpSettings DSC Resource default configuration for vSphere versions 6.5, 6.7 and 7.0:

Configuration VMHostNtpSettings_Default_Config {
    Param(
        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $Server,

        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [System.Management.Automation.PSCredential]
        $Credential,

        [Parameter(Mandatory = $true)]
        [ValidateNotNullOrEmpty()]
        [string]
        $VMHostName
    )

    Import-DscResource -ModuleName VMware.vSphereDSC

    Node localhost {
        VMHostNtpSettings VMHostNtpSettings {
            Server = $Server
            Credential = $Credential
            Name = $VMHostName
            NtpServer = @()
            NtpServicePolicy = 'Off'
        }
    }
}