title: Ansible: Conditional task parameter
body: <p>I need to pass <code>ssl_ca</code> to <code>mysql_db</code> module only if <code>mysql_use_ssl</code> is defined. Is this possible using one task, like:</p>
  
  <pre><code>mysql_db: name=mydb state=import target=/tmp/mysql.sql login_host="mydbhost" login_user="root" login_password="password" {% if mysql_use_ssl %}ssl_ca=/path/to/cert.pem{% endif %}
  </code></pre>
  
  <p>?</p>
  
  <p>This actual snippet does not work, result:</p>
  
  <pre><code>{"failed": true, "msg": "template error while templating string: Encountered unknown tag 'endif'.. String: /path/to/cert.pem{% endif %}"}
  </code></pre>
  
  <p>When moving the conditional as:</p>
  
  <pre><code>mysql_db: name=mydb state=import target=/tmp/mysql.sql login_host="mydbhost" login_user="root" login_password="password" ssl_ca="{% if mysql_use_ssl %}/path/to/cert.pem{% else %}none{% endif %}"
  </code></pre>
  
  <p>Then it "works" but <code>none</code> is not a supported parameter for turning off mysql ssl connection, so it does not turn off ssl.</p>