title: Using a variable when iterating over range in Ansible
body: <p>I have this task :</p>
  
  <pre class="lang-yaml prettyprint-override"><code>---
  - name: Deploy &amp; Register the Gitlab runners
    command: &gt;
      docker run
      --name runner{{item}}
      -d
      -e CI_SERVER_URL="{{CI_SERVER_URL}}"
      -e REGISTRATION_TOKEN="{{REGISTRATION_TOKEN}}"
      -e DOCKER_PRIVILEGED=true
      -e REGISTER_LOCKED=false
      -v /var/run/docker.sock:/var/run/docker.sock
      --restart=always
      flakm/gitlab-runner-auto-register:latest
    with_items:
      - [ 1 , 2 ]
  </code></pre>
  
  <p>which works. But I would like to be able to customise the number of the runners.</p>
  
  <p>So, I would like something like this </p>
  
  <pre class="lang-yaml prettyprint-override"><code>  with_items:
      - [ 1 , {{ NUMBER_ΟF_RUNNERS }} ]
  </code></pre>
  
  <p>but this does not work.</p>
  
  <p>I have read <a href="https://docs.ansible.com/ansible/latest/user_guide/playbooks_loops.html#loops" rel="nofollow noreferrer">this</a> from the Ansible docs, but could not find anything.</p>