title: Jenkins: For each loop issue
body: <p>I am using Jenkins to trigger an Ansible playbook. I would like to pass in an array of computer names in order for the Ansible playbook to trigger the playbook and image the machines one by one.</p>
  
  <p>In order to do this I believe I need a foreach loop.</p>
  
  <p>I have little skill in groovy/Jenkins and have ran into an issue. </p>
  
  <p><code>error = "Expected a symbol @ line..."</code> The line that this is referring to is HOSTS.each {item -></p>
  
  <p>Can someone please assist me? My script is below (I have edited out some private data) </p>
  
  <pre><code>pipeline {
      agent any
      // every day
      triggers {
          cron('H 7 * * *')
      }
  
      environment {
            HOSTS = ['node1','node2']
      }
  
  stages {
  
      stage('MachineDB Scheduler') {
              steps {
                  HOSTS.each { item -&gt; // review
                      HOSTNAME = ${item} // review
                      ansibuildPlaybookperf(
                          sshUser: env.USER,
                          vaultUser: env.USER,
                          server: "$SERVER",
                          dir: "$HOMEDIR/$BUILD_TAG",
                          playbook: "$PLAYBOOK",
                          extras: "--vault-password-file passmgr.sh",
                          extraVars: "$VARS_JENKINS"
                      )
                  }
              }
          }
      }
  }
  </code></pre>