-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
63 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 34 additions & 48 deletions
82
development/modules/MyWebapp/DSCResources/SimpleWebsite/SimpleWebsite.schema.psm1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,46 @@ | ||
Configuration SimpleWebsite | ||
Configuration SimpleWebsite | ||
{ | ||
param | ||
( | ||
[String]$WebAppPath = "c:\myWebApp", | ||
[String]$WebAppName = "MyWebApp", | ||
[String]$WebAppPath = "c:\myWebApp", | ||
[String]$WebSiteName = "MyWebApp", | ||
[String]$HostNameSuffix = "local", | ||
[String]$HostName = "vagrantdsc.${HostNameSuffix}", | ||
[String]$ApiAppPoolName = "MyWebAppPool", | ||
[HashTable]$AuthenticationInfo = @{Anonymous = "true"; Basic = "false"; Digest = "false"; Windows = "false"} | ||
) | ||
|
||
# Import-DscResource -Module cWebAdministration | ||
Import-DscResource -Module xWebAdministration | ||
Import-DscResource -Module cWebAdministration | ||
Import-DscResource -Module cNetworking | ||
|
||
# Stop the default website | ||
xWebsite DefaultSite | ||
{ | ||
Ensure = "Present" | ||
Name = "Default Web Site" | ||
State = "Stopped" | ||
PhysicalPath = "C:\inetpub\wwwroot" | ||
DependsOn = "[File]websiteIndex" | ||
} | ||
|
||
# Create a Web Application Pool | ||
xWebAppPool NewWebAppPool | ||
{ | ||
Name = "${WebAppName}AppPool" | ||
Ensure = "Present" | ||
State = "Started" | ||
} | ||
|
||
#Create a New Website with Port | ||
xWebSite NewWebSite | ||
{ | ||
Name = $WebAppName | ||
Ensure = "Present" | ||
BindingInfo = MSFT_xWebBindingInformation | ||
{ | ||
Port = 80 | ||
} | ||
PhysicalPath = $WebAppPath | ||
State = "Started" | ||
DependsOn = @("[xWebAppPool]NewWebAppPool") | ||
} | ||
|
||
File websiteIndex | ||
# Stop the default website | ||
cWebsite DefaultSite | ||
{ | ||
Ensure = "Present" | ||
Type = "File" | ||
DestinationPath = "$WebAppPath\index.html" | ||
SourcePath = "c:\vagrant\website\index.html" | ||
DependsOn = '[File]website' | ||
Ensure = "Absent" | ||
Name = "Default Web Site" | ||
State = "Stopped" | ||
PhysicalPath = "C:\inetpub\wwwroot" | ||
} | ||
|
||
File website | ||
cWebsite UrlSvcWebsite | ||
{ | ||
Ensure = "Present" | ||
Type = "Directory" | ||
DestinationPath = $WebAppPath | ||
Ensure = "Present" | ||
Name = $WebSiteName | ||
BindingInfo = @(SEEK_cWebBindingInformation | ||
{ | ||
Protocol = "http" | ||
Port = 80 | ||
IPAddress = "*" | ||
}) | ||
AuthenticationInfo = SEEK_cWebAuthenticationInformation { Anonymous = "true" } | ||
HostFileInfo = @(SEEK_cHostEntryFileInformation | ||
{ | ||
RequireHostFileEntry = $True | ||
HostEntryName = $HostName | ||
HostIpAddress = "10.0.0.30" | ||
}) | ||
PhysicalPath = $WebAppPath | ||
State = "Started" | ||
DependsOn = @("[cWebsite]DefaultSite") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Hello from Vagrant DSC! | ||
<h1>Hello from Vagrant DSC!</h1> | ||
<img src="http://www.drodd.com/images10/funny-cat-gifs17.gif" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters