1
Ich muss ssl_ca
zu mysql_db
Modul nur übergeben, wenn mysql_use_ssl
definiert ist. Ist dies mit einer Task möglich, z. B .:Ansible: Bedingter Task-Parameter
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 %}
?
Diese tatsächliche Snippet funktioniert nicht, Ergebnis:
{"failed": true, "msg": "template error while templating string: Encountered unknown tag 'endif'.. String: /path/to/cert.pem{% endif %}"}
Wenn das Bewegungs bedingte als:
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 %}"
es dann "funktioniert" aber none
sind keine unterstützten Parameter für mysql ssl Ausschalten Verbindung, so dass es nicht ausgeschaltet wird ssl.