Created
July 30, 2012 18:35
-
-
Save anonymous/3209014 to your computer and use it in GitHub Desktop.
Role options only appear if servers are defined
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
[me@localhost ~]$ cat rolebug | |
role :test1, :color => "\033[34m" | |
role :test2, 'localhost', :color => "\033[34m" | |
server "localhost", :test1, :test2 | |
task :date1, :roles => [:test1] do | |
run "date" do |channel, stream, data| | |
puts "options: #{channel[:server].options}, date: #{data}" | |
end | |
end | |
task :date2, :roles => [:test2] do | |
run "date" do |channel, stream, data| | |
puts "options: #{channel[:server].options}, date: #{data}" | |
end | |
end | |
[me@localhost ~]$ cap -f rolebug date1 | |
* executing `date1' | |
* executing "date" | |
servers: ["localhost"] | |
[localhost] executing command | |
options: {}, date: Mon Jul 30 14:34:11 EDT 2012 | |
command finished in 65ms | |
[me@localhost ~]$ cap -f rolebug date2 | |
* executing `date2' | |
* executing "date" | |
servers: ["localhost"] | |
[localhost] executing command | |
options: {:color=>"\e[34m"}, date: Mon Jul 30 14:34:18 EDT 2012 | |
command finished in 104ms |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment