Permalink
Browse files

added examples, modified README

  • Loading branch information...
1 parent 1f24cde commit 53ba8d081588e2cafb92f1b94318a24ff0d19805 @zenchild committed Sep 24, 2010
Showing with 66 additions and 19 deletions.
  1. +42 −19 README
  2. +24 −0 examples/capfile
View
61 README
@@ -1,26 +1,49 @@
-'winrm' can be used just like 'run'. For instance:
+--------------------------------------------------------------------------
+ WinRM for Capistrano
+--------------------------------------------------------------------------
+This is a library that adds WinRM functionality to Capistrano in order to
+talk to Micrsoft Windows systems. The set-up for WinRM is beyond the
+scope of this document so I encourage you to read the Microsoft WinRM
+installation documentation.
+http://msdn.microsoft.com/en-us/library/aa384426(v=VS.85).aspx
-task :ipconfig, :roles => :winrm do
- winrm 'ipconfig'
-end
-This will run ipconfig across all hosts in the :winrm role.
+My Info:
+BLOG: http://distributed-frostbite.blogspot.com/
+Add me in LinkedIn: http://www.linkedin.com/in/danwanek
-'winrm' will also accept a block exactly like 'run':
+--------------------------------------------------------------------------
-task :ipconfig, :roles => :winrm do
- host_data = {}
- winrm 'ipconfig' do |channel, stream, data|
- host_data[channel[:host]] = "" unless host_data[channel[:host]].is_a?(String)
- host_data[channel[:host]] << data
- end
+TO USE:
+require 'capistrano_winrm'
+set :winrm_user, 'myuser'
+set :winrm_password, 'mypass'
+set :winrm_ssl_ca_store, '/path/to/ssl/certs' # usually /etc/ssl/certs
- host_data.each_pair do |host,data|
- puts "HOST: #{host}"
- puts "---------------------------------------"
- puts data
- puts "---------------------------------------"
- end
-end
+--------------------------------------------------------------------------
+LICENSE:
+(The MIT License)
+
+Copyright (c) 2010 Dan Wanek <dan.wanek@gmail.com>
+Copyright (c) 2005-2008 Jamis Buck <jamis@37signals.com>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,24 @@
+require 'capistrano_winrm'
+
+# The ssl port will either be 443 for older WinRM implementations or 5986 for new versions.
+role :winrm, 'myhost:5986'
+set :winrm_user, 'user'
+set :winrm_password, 'pass'
+set :winrm_ssl_ca_store, '/etc/ssl/certs'
+
+desc 'use "winrm" to run a test task'
+task :testwinrm, :roles => :winrm do
+ host_data = {}
+ cmd = 'ipconfig'
+ winrm cmd do |channel, stream, data|
+ host_data[channel[:host]] = "" unless host_data[channel[:host]].is_a?(String)
+ host_data[channel[:host]] << data
+ end
+
+ host_data.each_pair do |host,data|
+ puts "HOST: #{host}"
+ puts "---------------------------------------"
+ puts data
+ puts "---------------------------------------"
+ end
+end

0 comments on commit 53ba8d0

Please sign in to comment.