title: Get variable from ansible inventory from specific group
body: <p>I'm trying to get specific variables from specific group, but it seems to lead me to strange results .</p>
  
  <p>Host file example:</p>
  
  <pre><code>[server_machine]
  zeus     account=app1
  
  [agent_machine]
  
  machine1   account=agent port_a=1000  port_b=1001 
  machine2   account=agent port_a=1200  port_b=1201 
  machine3   account=agent port_a=1300  port_b=1301 
  </code></pre>
  
  <p>What I'm trying to do is to run script on the <code>server_machine</code> group with parameters I get from the <code>agent_machines</code> group.</p>
  
  <p>This way the script will run 3 times on <code>server_machine</code> with all ports combinations.</p>
  
  <p>So basically I need playbook which might look like this:</p>
  
  <pre><code>- hosts: server_machine
  
  - tasks:
      - command: test.py --port_1 {{item}}  --port_2 {{item}}
        with_items:{{group.agent_machine.port_a, group.agent_machine.port_b }}
  </code></pre>
  
  <p>However, I can't make it work.</p>