title: Concatenate variables in ansible
body: <p>i'm trying to do the following task:</p>
  
  <pre><code> -name: Dump Server1 database to Server2
  
    shell: 'mysqldump -h {{ server1_ip }} -u {{ mysql_user }} --protocol=tcp --password={{ mysql_passwd }} --single-transaction --set-gtid-purged=off {{server1_db}} table1 table2 table3 &gt; dump.sql'
  </code></pre>
  
  <p>the idea of this task is to export database structure and the data of the tables that i want. In this example i only put 3 tables, but in real life it could be 20 or 30 tables. So, my idea is de do something like this:</p>
  
  <p>replace "table1 table2 table3 for something like "{{ tables }}" and then do a variable with multiple values, something like that:</p>
  
  <pre><code>tables:
    - table1
    - table2
    - table3
  
  ...
  </code></pre>
  
  <p>anyone knows the right way to do something like that? put a variable in the sentence and replace for a concatenation of the multiple values from a variable.</p>
  
  <p>Thanks in advance!</p>