text: In deploy scenario I need to create and run Jenkins task on the list of hosts, i.e. create something like a parametrized task (where ip address is a parameter) or a task on Multijob Plugin with HOST axis, but run by only 2 ones in parallel over multiple hosts. One of the options?
  Let's start solving this by assuming that we have configured the hosts to Jenkins master as Jenkins slaves, and also make sure that hosts are provided in the pipeline job parameter.
  Make HOSTS as a separated list. Go through the code
  def hosts_pairs = HOSTS.split().collate(2)for (pair in host_pairs) { def branches = [:] for (h in pair) { def host = h // new variable for every iteration; it will be mutated branches[host] = { stage(host) { node(host) { // here we mention the actual job,e.g. sh "echo hello world" } } } } parallel branches}