def generate_jobs(queue_servers, queue_template, queue_executable)
      counter = 0
      tasks = []
      Log.debug "[#{Chimp.get_job_uuid}] Loading queue..."
      #
      # Configure group
      #
      if not ChimpQueue[@group]
        ChimpQueue.instance.create_group(@group, @group_type, @group_concurrency)
      end

      #
      # Process Server selection
      #
      Log.debug("[#{Chimp.get_job_uuid}] Processing server selection for task creation")

      queue_servers.sort! { |a,b| a['name'] <=> b['name'] }
      queue_servers.each do |server|
        #
        # Handle limiting options
        #
        counter += 1
        next if @limit_start.to_i > 0 and counter < @limit_start.to_i
        break if @limit_end.to_i > 0 and counter > @limit_end.to_i

        #
        # Construct the Server object
        #
        s = Server.new

        s.params['href']                  = server['href']

        s.params['current_instance_href'] = s.params['href']
        s.params['current-instance-href'] = s.params['href']

        s.params['name']                  = server['name']
        s.params['nickname']              = s.params['name']

        s.params['ip_address']            = server['public_ip_addresses'].first
        s.params['ip-address']            = s.params['ip_address']

        s.params['private-ip-address']    = server['private_ip_addresses'].first
        s.params['private_ip_address']    = s.params['private-ip-address']

        s.params['resource_uid']          = server['resource_uid']
        s.params['resource-uid']          = s.params['resource_uid']

        s.params['instance-type']         = server['links']['instance_type']['name']
        s.params['instance_type']         = s.params['instance-type']
        s.params['ec2_instance_type']     = s.params['instance-type']
        s.params['ec2-instance-type']     = s.params['instance-type']

        s.params['dns-name']              = server['public_dns_names'].first
        s.params['dns_name']              = s.params['dns-name']

        s.params['locked']                = server['locked']
        s.params['state']                 = server['state']
        s.params['datacenter']            = server['links']['datacenter']['name']

        # This will be useful for later on when we need to run scripts
        Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation"
        begin
          tries ||= 3
          s.object = Connection.client.resource(server['href'])
          Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation COMPLETE"
        rescue
          Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (retrying)"
          sleep 30
          retry unless (tries -= 1).zero?
          Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (giving up)"
        end

        e = nil

        # If @script has been passed
        if queue_executable
          e = ExecRightScript.new(
            :server => s,
            :exec => queue_executable,
            :job_uuid => @job_uuid,
            :job_notes => @job_notes,
            :inputs => @inputs,
            :timeout => @timeout,
            :delay => @delay,
            :concurrency => @concurrency,
            :verbose => @@verbose,
            :quiet => @@quiet
          )
        elsif @ssh
          e = ExecSSH.new(
            :server => s,
            :ssh_user => @ssh_user,
            :exec => @ssh,
            :verbose => @@verbose,
            :quiet => @@quiet
          )
        elsif @report
          if s.href
            e = ExecReport.new(:server => s, :verbose => @@verbose, :quiet => @@quiet)
            e.fields = @report
          end
        elsif @set_tags.size > 0
          e = ExecSetTags.new(:server => s, :verbose => @@verbose, :quiet => @@quiet)
          e.tags = set_tags
        end

        if e != nil
          e.dry_run = @dry_run
          e.quiet   = @@quiet
          e.status  = Executor::STATUS_HOLDING if @hold

          Log.debug "[#{Chimp.get_job_uuid}] Pushing task (end of control)"
          tasks.push(e)
        end
      end
      return(tasks)
    end
def generate_jobs(queue_servers, queue_template, queue_executable)
      counter = 0
      tasks = []
      Log.debug "[#{Chimp.get_job_uuid}] Loading queue..."
      #
      # Configure group
      #
      if not ChimpQueue[@group]
        ChimpQueue.instance.create_group(@group, @group_type, @group_concurrency)
      end

      #
      # Process Server selection
      #
      Log.debug("[#{Chimp.get_job_uuid}] Processing server selection for task creation")

      queue_servers.sort! { |a,b| a['name'] <=> b['name'] }
      queue_servers.each do |server|
        #
        # Handle limiting options
        #
        counter += 1
        next if @limit_start.to_i > 0 and counter < @limit_start.to_i
        break if @limit_end.to_i > 0 and counter > @limit_end.to_i

        #
        # Construct the Server object
        #
        s = Server.new

        s.params['href']                  = server['href']

        s.params['current_instance_href'] = s.params['href']
        s.params['current-instance-href'] = s.params['href']

        s.params['name']                  = server['name']
        s.params['nickname']              = s.params['name']

        s.params['ip_address']            = server['public_ip_addresses'].first
        s.params['ip-address']            = s.params['ip_address']

        s.params['private-ip-address']    = server['private_ip_addresses'].first
        s.params['private_ip_address']    = s.params['private-ip-address']

        s.params['resource_uid']          = server['resource_uid']
        s.params['resource-uid']          = s.params['resource_uid']

        s.params['instance-type']         = server['links']['instance_type']['name']
        s.params['instance_type']         = s.params['instance-type']
        s.params['ec2_instance_type']     = s.params['instance-type']
        s.params['ec2-instance-type']     = s.params['instance-type']

        s.params['dns-name']              = server['public_dns_names'].first
        s.params['dns_name']              = s.params['dns-name']

        s.params['locked']                = server['locked']
        s.params['state']                 = server['state']
        s.params['datacenter']            = server['links']['datacenter']['name']

        # This will be useful for later on when we need to run scripts
        Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation"
        begin
          tries ||= 3
          s.object = Connection.client.resource(server['href'])
          Log.debug "[#{Chimp.get_job_uuid}] Making API 1.5 call: client.resource (SERVER) for task creation COMPLETE"
        rescue
          Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (retrying)"
          sleep 30
          retry unless (tries -= 1).zero?
          Log.error "[#{Chimp.get_job_uuid}] Failed to load server href via API1.5 for task creation (giving up)"
        end

        e = nil

        # If @script has been passed
        if queue_executable
          e = ExecRightScript.new(
            :server => s,
            :exec => queue_executable,
            :job_uuid => @job_uuid,
            :job_notes => @job_notes,
            :inputs => @inputs,
            :timeout => @timeout,
            :delay => @delay,
            :concurrency => @concurrency,
            :verbose => @@verbose,
            :quiet => @@quiet
          )
        elsif @ssh
          e = ExecSSH.new(
            :server => s,
            :ssh_user => @ssh_user,
            :exec => @ssh,
            :verbose => @@verbose,
            :quiet => @@quiet
          )
        elsif @report
          if s.href
            e = ExecReport.new(:server => s, :verbose => @@verbose, :quiet => @@quiet)
            e.fields = @report
          end
        elsif @set_tags.size > 0
          e = ExecSetTags.new(:server => s, :verbose => @@verbose, :quiet => @@quiet)
          e.tags = set_tags
        end

        if e != nil
          e.dry_run = @dry_run
          e.quiet   = @@quiet
          e.status  = Executor::STATUS_HOLDING if @hold

          Log.debug "[#{Chimp.get_job_uuid}] Pushing task (end of control)"
          tasks.push(e)
        end
      end
      return(tasks)
    end
Load up the queue with work