Sha256: d8183af45b322af6fe26478dd92dffaf5c5b0bb43db6b8f606967540f22a7f47
Contents?: true
Size: 1.44 KB
Versions: 6
Compression:
Stored size: 1.44 KB
Contents
require 'capistrano/cli' require 'pp' module Sprinkle module Actors class Dummy < Actor #:nodoc: def initialize(&block) #:nodoc: # @config.set(:_sprinkle_actor, self) @roles={} self.instance_eval &block end def role(role, server, opts={}) @roles[role]||=[] @roles[role] << [ server, opts ] end # Determines if there are any servers for the given roles def servers_for_role?(roles) roles=Array(roles) roles.any? { |r| @roles.keys.include?(r) } end def install(installer, roles, opts={}) if per_host=opts.delete(:per_host) servers_per_role(roles).each do |server| installer.reconfigure_for(server) installer.announce process(installer.package.name, installer.install_sequence, server, opts) end else process(installer.package, installer.install_sequence, roles, opts) end end def sudo? false end def verify(verifier, roles, opts = {}) process(verifier.package.name, verifier.commands, roles, opts = {}) end def servers_per_role(role) @roles[role] end def process(name, commands, roles, opts = {}) #:nodoc: # puts "PROCESS: #{name} on #{roles}" pp commands # return false if suppress_and_return_failures true end end end end
Version data entries
6 entries across 6 versions & 1 rubygems