Idiomatic way to read .env variables in Ansible?

Posted by Arms on Super User See other posts from Super User or by Arms
Published on 2014-06-01T15:23:33Z Indexed on 2014/06/01 15:32 UTC
Read the original article Hit count: 261

I'm provisioning a Vagrant box with Ansible, and using Benno Joy's MySQL role to setup MySQL (including creating a database and users.) The database name and credentials are stored in a .env file in the project's root. What would be the idiomatic way to use these variables when provisioning MySQL?

Should I write a custom script that generates a YAML file from my .env, and then use the include_vars module? Or is there a simpler way?

© Super User or respective owner

Related posts about mysql

Related posts about environment-variables