lib/poolparty/net/remote_instance.rb in poolparty-0.2.18 vs lib/poolparty/net/remote_instance.rb in poolparty-0.2.69

- old
+ new

@@ -5,15 +5,17 @@ class RemoteInstance include Remote include Configurable include CloudResourcer - - def initialize(opts, parent=self) - @parent = parent + + def initialize(opts, parent=nil) + run_setup(parent) + set_vars_from_options(parent.options) if parent && parent.respond_to?(:options) set_vars_from_options(opts) unless opts.nil? || opts.empty? + on_init end # Callback def on_init @@ -59,15 +61,35 @@ end # Printing. This is how we extract the instances into the listing on the # local side into the local listing file def to_s - "#{name}\t#{ip}" + "#{name}\t#{ip}\t#{instance_id}" end - # Commands for the servers def puppet_runner_command - ". /etc/profile && /usr/sbin/puppetd --onetime --no-daemonize --logdest syslog --server master 2>&1" + self.class.send :puppet_runner_command + end + # Commands for the servers + def self.puppet_runner_command + ". /etc/profile && puppetrunner" + end + def self.puppet_master_rerun_command + ". /etc/profile && puppetrerun" + end + def self.puppet_rerun_commad + puppet_runner_command + end + def cloud + @pa = parent + while !(@pa.is_a?(PoolParty::Cloud::Cloud) || @pa.nil? || @pa == self) + @pa = @pa.parent + end + @pa + end + def hosts_file_listing_for(cl) + string = (cl.name == cloud.name) ? "#{name}.#{cloud.name}\t#{name}" : "#{name}.#{cloud.name}" + "#{internal_ip}\t#{string}" end end end end \ No newline at end of file