title: Partitioning data across hosts in Ansible (access "index" of host in task?)
body: <p>I am trying to use Ansible to do some parallel computation. My data is trivially parallelizable, I just need to split the file across my hosts (EC2 instances). Is there a canonical way to do this?</p>
  
  <p>The next best thing would be to have a counter that increments for each host. Assuming I have already split my data into my number of workers, I would like to be able to say within each worker task:</p>
  
  <pre><code>- file: src=data/users-{{host_index}}.csv dest=/mnt/users.csv`.
  </code></pre>
  
  <p>Then, each worker can process their copy of <code>users.csv</code> with a separate script, that is agnostic to which set of users they have. Is there any way to get this counter index?</p>
  
  <p>I am a beginner to Ansible, so I wonder whether I am overlooking a simple module or idiom, either in Ansible or Jinja. Thanks in advance.</p>