title: Jenkins Swarm plugin - Evironmental variables
body: <p>I have latest Jenkins and using it's latest Swarm Plugin.</p>
  
  <p>I have written Ansible modules/roles/playbooks to setup install various tools/configuration on a given target node (which I would like to use as a Swarm slave node).</p>
  
  <p>After Ansible playbook run is complete, I now see a new Slave is created and attached to my Jenkins master but Swarm Plugin's docs (Available Options) doesn't mention how to create ENVIRONMENT variables in the slave. <a href="https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin" rel="nofollow">https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin</a></p>
  
  <p>My question is:</p>
  
  <ol>
  <li><p>How can I have multiple slaves created on a same target machine and they all <strong>have their own individual settings</strong> for setting various tools like JAVA_HOME, M2_HOME, GRADLE_HOME, PATH etc.</p></li>
  <li><p>How can I set ENVIRONMENT variables for a slave using Swarm plugin? 
  This is required as if I created a slave whose default JAVA is jdk1.7.0_67, then I would like to create another slave whose default JAVA_HOME is jdk1.8.0_45. Similarly, the end goal is to have various flavors of such slaves with various tools if possible, where each slave's tools are slightly different.  I'll assign the LABEL(s) accordingly and use it in a Jenkins job's configuration so that a job runs only using / on these slave if the associated label is assigned/tied to the job.</p></li>
  </ol>
  
  <p>I tried using <a href="https://github.com/MovingBlocks/GroovyJenkins/blob/master/src/main/groovy/AddNodeToJenkins.groovy" rel="nofollow">https://github.com/MovingBlocks/GroovyJenkins/blob/master/src/main/groovy/AddNodeToJenkins.groovy</a> but not sure how I can automatically define/set ENVIRONMENT variables in the slave's configuration.</p>