This commit is contained in:
Michael Greene 2018-02-21 10:41:43 -06:00
Родитель a9ea6acaa7
Коммит d64bb6db50
3 изменённых файлов: 122 добавлений и 220 удалений

Просмотреть файл

@ -1,126 +0,0 @@
#
# Module manifest for module 'DNSServerConfig'
#
# Generated by: Michael Greene
#
# Generated on: 11/3/2016
#
@{
# Script module or binary module file associated with this manifest.
RootModule = '.\WindowsDNSServer.Config.psm1'
# Version number of this module.
ModuleVersion = '0.1.0.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely identify this module
GUID = '8f0a25bb-e464-44d3-9f20-aeeb6185000e'
# Author of this module
Author = 'Michael Greene'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement for this module
Copyright = '(c) 2016 Michael Greene. All rights reserved.'
# Description of the functionality provided by this module
Description = 'This module contains PowerShell Desired State Configuration solutions for deploying and configuring DNS Servers'
# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '4.0'
# Name of the Windows PowerShell host required by this module
# PowerShellHostName = ''
# Minimum version of the Windows PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
CLRVersion = '4.0'
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = "xDNSServer"; ModuleVersion = "1.7.0.0"})
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = '*'
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = '*'
# Variables to export from this module
VariablesToExport = '*'
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'
# DSC resources to export from this module
# DscResourcesToExport = @()
# List of all modules packaged with this module
# ModuleList = @()
# List of all files packaged with this module
# FileList = @()
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PSData = @{
# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'DSC', 'Configuration', 'DNS'
# A URL to the license for this module.
# LicenseUri = ''
# A URL to the main website for this project.
ProjectUri = 'http://github.com/microsoft/dnsserverconfig'
# A URL to an icon representing this module.
# IconUri = ''
# ReleaseNotes of this module
# ReleaseNotes = ''
# Operating Systems supported by Configurations in this module
WindowsOSVersion = '2016-Nano-Server'
# '2008-R2-SP1','2012-Datacenter','2012-R2-Datacenter','2016-Datacenter','2016-Nano-Server'
} # End of PSData hashtable
} # End of PrivateData hashtable
# HelpInfo URI of this module
# HelpInfoURI = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
}

Просмотреть файл

@ -1,87 +1,105 @@
configuration WindowsDNSServerWithZones
{
<#
.DESCRIPTION
Basic configuration for Windows DNS Server with zones and records
.EXAMPLE
WindowsDNSServer -outpath c:\dsc\
.NOTES
This configuration requires the corresponding configdata file
#>
Import-DscResource -module 'xDnsServer', 'PSDesiredStateConfiguration'
Node $AllNodes.NodeName
{
# WindowsOptionalFeature is compatible with the Nano Server installation option
WindowsOptionalFeature DNS
{
Ensure = 'Enable'
Name = 'DNS-Server-Full-Role'
}
foreach ($Zone in $Node.ZoneData)
{
xDnsServerPrimaryZone $Zone.PrimaryZone
{
Ensure = 'Present'
Name = $Zone.PrimaryZone
DependsOn = '[WindowsOptionalFeature]DNS'
}
foreach ($ARecord in $Zone.ARecords.Keys)
{
xDnsRecord "$($Zone.PrimaryZone)_$ARecord"
{
Ensure = 'Present'
Name = $ARecord
Zone = $Zone.PrimaryZone
Type = 'ARecord'
Target = $Zone.ARecords[$ARecord]
DependsOn = "[WindowsOptionalFeature]DNS","[xDnsServerPrimaryZone]$($Zone.PrimaryZone)"
}
}
foreach ($CNameRecord in $Zone.CNameRecords.Keys)
{
xDnsRecord "$($Zone.PrimaryZone)_$CNameRecord"
{
Ensure = 'Present'
Name = $CNameRecord
Zone = $Zone.PrimaryZone
Type = 'CName'
Target = $Zone.CNameRecords[$CNameRecord]
DependsOn = "[WindowsOptionalFeature]DNS","[xDnsServerPrimaryZone]$($Zone.PrimaryZone)"
}
}
}
}
}
configuration WindowsDNSServerBasic
{
<#
.DESCRIPTION
Basic configuration for Windows DNS Server with no zones created
.EXAMPLE
WindowsDNSServer -outpath c:\dsc\
.NOTES
This is the most basic configuration and does not take parameters or configdata
#>
Import-DscResource -module 'PSDesiredStateConfiguration'
Node localhost
{
# WindowsOptionalFeature is compatible with the Nano Server installation option
WindowsOptionalFeature DNS
{
Ensure = 'Enable'
Name = 'DNS-Server-Full-Role'
}
}
}
<#PSScriptInfo
.VERSION 0.1.0
.GUID 2d1436b4-b53a-42ea-80d6-8495742fdede
.AUTHOR Michael Greene
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/Microsoft/WindowsDNSServerConfig/blob/master/LICENSE
.PROJECTURI https://github.com/Microsoft/WindowsDNSServerConfig
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
https://github.com/Microsoft/WindowsDNSServerConfig/blob/master/README.md##releasenotes
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>
#Requires -Module xDNSServer
<#
.DESCRIPTION
This module contains PowerShell Desired State Configuration solutions for deploying and configuring DNS Servers
#>
Param()
configuration WindowsDNSServerConfig
{
<#
.DESCRIPTION
Basic configuration for Windows DNS Server with zones and records
.EXAMPLE
WindowsDNSServer -outpath c:\dsc\
.NOTES
This configuration requires the corresponding configdata file
#>
Import-DscResource -module 'xDnsServer','PSDesiredStateConfiguration'
Node $AllNodes.NodeName
{
# WindowsOptionalFeature is compatible with the Nano Server installation option
WindowsOptionalFeature DNS
{
Ensure = 'Enable'
Name = 'DNS-Server-Full-Role'
}
foreach ($Zone in $Node.ZoneData)
{
xDnsServerPrimaryZone $Zone.PrimaryZone
{
Ensure = 'Present'
Name = $Zone.PrimaryZone
DependsOn = '[WindowsOptionalFeature]DNS'
}
foreach ($ARecord in $Zone.ARecords.Keys)
{
xDnsRecord "$($Zone.PrimaryZone)_$ARecord"
{
Ensure = 'Present'
Name = $ARecord
Zone = $Zone.PrimaryZone
Type = 'ARecord'
Target = $Zone.ARecords[$ARecord]
DependsOn = "[WindowsOptionalFeature]DNS","[xDnsServerPrimaryZone]$($Zone.PrimaryZone)"
}
}
foreach ($CNameRecord in $Zone.CNameRecords.Keys)
{
xDnsRecord "$($Zone.PrimaryZone)_$CNameRecord"
{
Ensure = 'Present'
Name = $CNameRecord
Zone = $Zone.PrimaryZone
Type = 'CName'
Target = $Zone.CNameRecords[$CNameRecord]
DependsOn = "[WindowsOptionalFeature]DNS","[xDnsServerPrimaryZone]$($Zone.PrimaryZone)"
}
}
}
}
}

Просмотреть файл

@ -1,13 +1,17 @@
version: 1.0.{build}.0
version: 0.1.0.{build}
clone_folder: c:\projects\$(APPVEYOR_PROJECT_NAME)
environment:
DiagnoseRG: true
RequiredModules: xDNSServer
TestResultsUploadURI: https://ci.appveyor.com/api/testresults/nunit/$(APPVEYOR_JOB_ID)
ApplicationID:
secure: 5JWP6B9VhBdRcGCKkRuQrutlU4VaHAf1naQe6Y/ECBlwZ9xeFnnJat2WRuLlgkkT
secure: mHB9K9ItLkpdxUR7WgBnuBiBOl3qgJT1yizvFZDOgkRxvTV5KoZJ8QuAp+F+EbV0
SubscriptionID:
secure: fhB5mHXLFRRc1/iwqCA9ibCqwg7qKqkayknhebLsM+FdlrmL80HCRm1vJYafomei
TenantID:
secure: J/my7xsOE9jewR0DDhD+EU5jeo5Bp83/nmIK8a8QI0QLoZXStCOtk1vUjVsKylW2
ApplicationPassword:
secure: oThZqzlElKkKPIxIey6ucKvhhPDK7Nx4VjTrcZm8CGD/n8NOo7hQ+foNO1mCd+HX
TestResultsUploadURI: https://ci.appveyor.com/api/testresults/nunit/$(APPVEYOR_JOB_ID)
secure: zV3r4bwG65rWRfF1L23RYLj7GXVxsMdZtasCsX0+pYA=
BuildFolder: $(APPVEYOR_BUILD_FOLDER)
ProjectName: $(APPVEYOR_PROJECT_NAME)
ProjectID: $(APPVEYOR_POJECT_ID)
@ -15,10 +19,16 @@ environment:
matrix:
fast_finish: true
install:
- git clone https://github.com/Microsoft/DscConfiguration.Tests
- git clone https://github.com/PowerShell/DscConfiguration.Tests
- ps: |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.205 -Force | Out-Null
Install-Module InvokeBuild -force
$null = Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.208 -Force
Install-Module -Name PowerShellGet -MinimumVersion 1.6.0 -Repository PSGallery -Force
Install-Module InvokeBuild,Pester,PSScriptAnalyzer -Force -SkipPublisherCheck -Repository PSGallery
# Load required modules from gallery
foreach ($module in $env:RequiredModules.split(',')) {
Install-Module $module -Force -Repository PSGallery
}
build_script:
- ps: |
if (Test-Path -Path .\.build.ps1) {