Lab 12 - Solution¶
- Solution Project: https://github.com/pstauffer/flask-mysql-app/tree/master/lab12_solution
Important
This is just an example of a solution.
You can also split the project into more roles and work with dependencies
- mysql role (reusable for other projects)
- gunicorn role (reusable for other projects)
- flask role (reusable for other projects)
- git role (reusable for other projects)
Use fixed variables inside the roles in
vars/main.ymlManage the whole
my.cnfas template and add theansible_managedheaderVerify, if the
databasealready exists (to replace theignore_errors)Use fixed versions for the packages (gunicorn, mysql-server, ...) to make sure, the application works with this versions
put the RedHat / Debian part into own files
redhat.yml / ``debian.ymlVerify, if the application (gunicorn) is already running (to make the task idempotent)
use tags
Commit your changes¶
- add all files to your git repo and commit it
git status
git add *
git commit -m 'lab 12'