vagrant-dsc 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8240a3495c72f76f0e6401942afde084014bc466
4
- data.tar.gz: 3e8f36d14b7ef86b7e556435e8fd3d151f2e0b62
3
+ metadata.gz: a23d07bfdced212c1036b9e3d36092a018eecb6a
4
+ data.tar.gz: 382422fdff1951d30eda2baab87ce2e8d53364b5
5
5
  SHA512:
6
- metadata.gz: 24fa42974fa2cbf15b6d3e170a4f66a7dcc5b45f405f55a4f693fd93c2c550495f5d9f793adcfbe8749ee88d2d609d4a7f3bfa300723a40cc93a2e717415acbe
7
- data.tar.gz: e5a2da9736b7bdcd84d10ae2bb5d2a33db9654b34c8c0b256e18e3f46575563e1e6bd2989eda3e266cc967ef4eaed13fe6f4c0829f6799822a8c4a4db737e4f8
6
+ metadata.gz: f33aaf4511ccba1237e193f7e908fdd21a34a9e4d9277bb53b8ed004d3333235d2215995c9d9287660266034b8276198733525b73ff1d1becd848e21e477eb41
7
+ data.tar.gz: d0bb148d250e5917b3a23a89f76df674e15fa87622b90af2d7f5a9b41e15b47ca208c947c226e280a17a1fde17ae409822affc4d3a8fe863fe01532e8f3fac58
data/.gitignore CHANGED
@@ -21,4 +21,5 @@ tmp
21
21
  *.a
22
22
  mkmf.log
23
23
  .vagrant
24
- .idea
24
+ .idea
25
+ .tags*
data/README.md CHANGED
@@ -33,7 +33,7 @@ In your Vagrantfile, add the following plugin and configure to your needs:
33
33
  # Set of Parameters to pass to the DSC Configuration.
34
34
  #
35
35
  # To pass in flags, simply set the value to `nil`
36
- dsc.configuration_params = {"machineName" => "localhost", "-EnableDebug" => nil}
36
+ dsc.configuration_params = {"-MachineName" => "localhost", "-EnableDebug" => nil}
37
37
 
38
38
  # Relative path to a folder containing a pre-generated MOF file.
39
39
  #
@@ -1,6 +1,12 @@
1
1
  # -*- mode: ruby -*-
2
2
  # vi: set ft=ruby :
3
3
 
4
+ $shell_script = <<SCRIPT
5
+ (iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')))>$null 2>&1
6
+ choco install seek-dsc
7
+ Get-DSCResource
8
+ SCRIPT
9
+
4
10
  # Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
5
11
  VAGRANTFILE_API_VERSION = "2"
6
12
 
@@ -17,13 +23,20 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
17
23
 
18
24
  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
19
25
  config.vm.network :forwarded_port, guest: 80, host: 8000, id: "web" # Port forward for IIS
20
- config.vm.network :forwarded_port, guest: 8443, host: 443, id: "ssl" # Port forward for SSL IIS
26
+ config.vm.network :forwarded_port, guest: 443, host: 8443, id: "ssl" # Port forward for SSL IIS
27
+ config.vm.network :forwarded_port, guest: 22, host: 9222, id: "ssh" # Port forward for SSL IIS
21
28
 
22
29
  config.vm.provider "virtualbox" do |v|
23
- v.customize ["modifyvm", :id, "--vram", "128"]
24
30
  v.gui = true
25
31
  end
26
32
 
33
+ # Install Chocolatey and some basic DSC Resources
34
+ config.vm.provision "shell", inline: $shell_script
35
+
36
+ # Upload Website
37
+ config.vm.provision "file", source: "website", destination: "c:\\my-web-app"
38
+
39
+ # Run DSC
27
40
  config.vm.provision "dsc" do |dsc|
28
41
 
29
42
  # Set of module paths relative to the Vagrantfile dir.
@@ -64,6 +77,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
64
77
  #dsc.synced_folder_type = ""
65
78
 
66
79
  # Temporary working directory on the guest machine.
67
- #dsc.temp_dir = "/tmp/vagrant-dsc"
80
+ # dsc.temp_dir = "c:/tmp/vagrant-dsc"
68
81
  end
69
- end
82
+ end
@@ -1,17 +1,30 @@
1
- Configuration MyWebsite
2
- {
3
- param ($MachineName)
4
-
5
- Node $MachineName
6
- {
7
- #Install the IIS Role
8
- File website
9
- {
10
- Ensure = "Present"
11
- Type = "Directory"
12
- DestinationPath = "c:\mywebroot"
13
- }
14
- }
15
- }
16
-
17
- Write-Output "Hello from DSC Provisioner: Config file"
1
+ Configuration MyWebsite
2
+ {
3
+ param ($MachineName)
4
+
5
+ Import-DscResource -Module cWebAdministration
6
+ Import-DscResource -Module MyWebapp
7
+
8
+ Node $MachineName
9
+ {
10
+ WindowsFeature IIS
11
+ {
12
+ Ensure = "Present"
13
+ Name = "Web-Server"
14
+ }
15
+ cWebsite DefaultWebsite
16
+ {
17
+ Name = "Default Web Site"
18
+ ApplicationPool = "DefaultAppPool"
19
+ PhysicalPath = "$env:SystemDrive\inetpub\wwwroot"
20
+ Ensure = "Absent"
21
+ DependsOn = '[WindowsFeature]IIS'
22
+ }
23
+
24
+ SimpleWebsite sWebsite
25
+ {
26
+ WebAppPath = "c:\my-new-webapp"
27
+ DependsOn = '[cWebsite]DefaultWebsite'
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,44 @@
1
+ Configuration SimpleWebsite
2
+ {
3
+ param
4
+ (
5
+ [String]$WebAppPath = "c:\myWebApp",
6
+ [String]$WebAppName = "MyWebApp",
7
+ [HashTable]$AuthenticationInfo = @{Anonymous = "true"; Basic = "false"; Digest = "false"; Windows = "false"}
8
+ )
9
+
10
+ Import-DscResource -Module cWebAdministration
11
+
12
+ # Create the new Website
13
+ cWebsite Basic
14
+ {
15
+ Ensure = 'Present'
16
+ Name = $WebAppName
17
+ PhysicalPath = $WebAppPath
18
+ ApplicationPool = "DefaultAppPool"
19
+ AuthenticationInfo = SEEK_cWebAuthenticationInformation
20
+ {
21
+ Anonymous = $AuthenticationInfo.Anonymous
22
+ Basic = $AuthenticationInfo.Basic
23
+ Digest = $AuthenticationInfo.Digest
24
+ Windows = $AuthenticationInfo.Windows
25
+ }
26
+ DependsOn = '[File]website'
27
+ }
28
+
29
+ File websiteIndex
30
+ {
31
+ Ensure = "Present"
32
+ Type = "File"
33
+ DestinationPath = "$WebAppPath\index.html"
34
+ SourcePath = "c:\vagrant\website\index.html"
35
+ DependsOn = '[File]website'
36
+ }
37
+
38
+ File website
39
+ {
40
+ Ensure = "Present"
41
+ Type = "Directory"
42
+ DestinationPath = $WebAppPath
43
+ }
44
+ }
@@ -0,0 +1 @@
1
+ Hello from Vagrant DSC!
@@ -8,8 +8,10 @@
8
8
 
9
9
  # Set the local PowerShell Module environment path
10
10
  <% if options[:module_paths] %>
11
- echo "Adding to path: <%= options[:module_paths] %>"
12
- $env:PSModulePath="<%= options[:module_paths] %>;${env:PSModulePath}"
11
+ $absoluteModulePaths = [string]::Join(";", ("<%= options[:module_paths] %>".Split(";") | ForEach-Object { $_ | Resolve-Path }))
12
+
13
+ echo "Adding to path: $absoluteModulePaths"
14
+ $env:PSModulePath="$absoluteModulePaths;${env:PSModulePath}"
13
15
  <% end %>
14
16
 
15
17
  $script = $(Join-Path "<%= options[:temp_path] %>" "<%= options[:configuration_file] %>")
@@ -1,5 +1,5 @@
1
1
  module Vagrant
2
2
  module Dsc
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
@@ -256,8 +256,10 @@ describe VagrantPlugins::DSC::Provisioner do
256
256
  #
257
257
 
258
258
  # Set the local PowerShell Module environment path
259
- echo \"Adding to path: /tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\"
260
- $env:PSModulePath=\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1;${env:PSModulePath}\"
259
+ $absoluteModulePaths = [string]::Join(\";\", (\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\".Split(\";\") | ForEach-Object { $_ | Resolve-Path }))
260
+
261
+ echo \"Adding to path: $absoluteModulePaths\"
262
+ $env:PSModulePath=\"$absoluteModulePaths;${env:PSModulePath}\"
261
263
 
262
264
  $script = $(Join-Path \"/tmp/vagrant-dsc-1\" \"manifests/MyWebsite.ps1\")
263
265
  echo \"PSModulePath Configured: ${env:PSModulePath}\"
@@ -293,8 +295,10 @@ $response"
293
295
  #
294
296
 
295
297
  # Set the local PowerShell Module environment path
296
- echo \"Adding to path: /tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\"
297
- $env:PSModulePath=\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1;${env:PSModulePath}\"
298
+ $absoluteModulePaths = [string]::Join(\";\", (\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\".Split(\";\") | ForEach-Object { $_ | Resolve-Path }))
299
+
300
+ echo \"Adding to path: $absoluteModulePaths\"
301
+ $env:PSModulePath=\"$absoluteModulePaths;${env:PSModulePath}\"
298
302
 
299
303
  $script = $(Join-Path \"/tmp/vagrant-dsc-1\" \"manifests/MyWebsite.ps1\")
300
304
  echo \"PSModulePath Configured: ${env:PSModulePath}\"
@@ -328,8 +332,10 @@ $response"
328
332
  #
329
333
 
330
334
  # Set the local PowerShell Module environment path
331
- echo \"Adding to path: /tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\"
332
- $env:PSModulePath=\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1;${env:PSModulePath}\"
335
+ $absoluteModulePaths = [string]::Join(\";\", (\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\".Split(\";\") | ForEach-Object { $_ | Resolve-Path }))
336
+
337
+ echo \"Adding to path: $absoluteModulePaths\"
338
+ $env:PSModulePath=\"$absoluteModulePaths;${env:PSModulePath}\"
333
339
 
334
340
  $script = $(Join-Path \"/tmp/vagrant-dsc-1\" \"manifests/MyWebsite.ps1\")
335
341
  echo \"PSModulePath Configured: ${env:PSModulePath}\"
@@ -348,7 +354,7 @@ $response += Start-DscConfiguration -Force -Wait -Verbose -Path $StagingPath 4>&
348
354
  $response"
349
355
 
350
356
  expect(script).to eq(expect_script)
351
- end
357
+ end
352
358
  end
353
359
 
354
360
  context "with a MOF file specified" do
@@ -366,8 +372,10 @@ $response"
366
372
  #
367
373
 
368
374
  # Set the local PowerShell Module environment path
369
- echo \"Adding to path: /tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\"
370
- $env:PSModulePath=\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1;${env:PSModulePath}\"
375
+ $absoluteModulePaths = [string]::Join(\";\", (\"/tmp/vagrant-dsc-1/modules-0;/tmp/vagrant-dsc-1/modules-1\".Split(\";\") | ForEach-Object { $_ | Resolve-Path }))
376
+
377
+ echo \"Adding to path: $absoluteModulePaths\"
378
+ $env:PSModulePath=\"$absoluteModulePaths;${env:PSModulePath}\"
371
379
 
372
380
  $script = $(Join-Path \"/tmp/vagrant-dsc-1\" \"manifests/MyWebsite.ps1\")
373
381
  echo \"PSModulePath Configured: ${env:PSModulePath}\"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-dsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Fellows
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-02 00:00:00.000000000 Z
11
+ date: 2014-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -166,6 +166,10 @@ files:
166
166
  - Rakefile
167
167
  - development/Vagrantfile
168
168
  - development/manifests/MyWebsite.ps1
169
+ - development/modules/MyWebapp/DSCResources/SimpleWebsite/SimpleWebsite.psd1
170
+ - development/modules/MyWebapp/DSCResources/SimpleWebsite/SimpleWebsite.schema.psm1
171
+ - development/modules/MyWebapp/MyWebapp.psd1
172
+ - development/website/index.html
169
173
  - lib/vagrant-dsc.rb
170
174
  - lib/vagrant-dsc/config.rb
171
175
  - lib/vagrant-dsc/locales/en.yml