title: How do I make Jenkins pipeline run in (any) agent machine, but never master?
body: <p>My  Jenkins pipeline  randomly alternates between running on master and on agent (slave) machines. </p>
  
  <p>The whole pipeline  has only one <code>agent</code> statement, thus:</p>
  
  <pre><code>pipeline {
    agent any
  </code></pre>
  
  <p>How can I get the build to run in load-balanced agents, and never master?</p>
  
  <ul>
  <li><p>Maybe it could be done with <code>agent { label 'some-label' }</code>. Is there a predefined label that specifies   agents  and not master? Or do I have to label all agents myself?</p></li>
  <li><p><a href="https://stackoverflow.com/questions/43733917/">This</a> and <a href="https://serverfault.com/questions/922352/">this</a> show how to choose   a <em>specific</em> agent, but I want random balancing between agent machines.</p></li>
  <li><a href="https://stackoverflow.com/questions/49267523/">This question</a> discusses <code>agent any</code> vs <code>agent none</code>, but neither of those blocks the master from being used.</li>
  <li><a href="https://zwischenzugs.com/2017/04/23/things-i-wish-i-knew-before-using-jenkins-pipelines/" rel="noreferrer">This page</a> recommends wrapping everything in a <code>node</code> stanza, but that seems to force the build to run on master or a specified node, which again does not allow balancing of agents.</li>
  </ul>