title: Processing vars in playbook
body: <p>I want to make a script to quickly setup a TINC vpn between computer instances. What I would need is a way to pass through the command line of "/tmp/setup_tinc.py" the following args:</p>
  
  <pre><code>--connect-to %{{ ' '.join( groups['do'] }}%
  </code></pre>
  
  <p>Where the <code>%{{ part }}%</code> would be interpreted in python. But I can't seem to find a good way to do this. <strong>Can you help me fix this code ?</strong></p>
  
  <p>I made the <a href="https://gist.github.com/fclairamb/5340949#file-setup_tinc-yml" rel="nofollow">following playbook</a>:</p>
  
  <pre><code>- name: tinc install &amp; setup
    hosts: do
    user: root
    vars:
      tincnet: cloudnet
    tasks:
    - name: Install tinc package
      action: command apt-get install tinc python-argparse -y
    - name: Copy tinc setup script
      action: copy src=setup_tinc.py dest=/tmp/setup_tinc.py mode=755
    - name: Run tinc setup script
      action: command /tmp/setup_tinc.py --network $tincnet --tinc-ip $tinc_ip --hostname     $hostname
    - name: Fetch back the tinc file
      action: fetch src=/etc/tinc/$tincnet/hosts/$hostname dst=hosts
    - name: Adding firewall rule
      action: command ufw allow 514
  </code></pre>