I'm finding lots of examples of how to manage posgresql with ansible (Linux), however, all of them contain the most basic things (install package, start service, create db, create user), but not the most important thing: create the tables.
I have a SQL file with the tables for my database but I don't know how to properly use it as an input in my ansible role. I'm hoping I don't need to use the
shell module to just execute the SQL, because as far as I understand that's a no-no in the ansible world (especially because we may need a way first to check if the tables have already been created in a previous run).
How to do this? Any sample out there? Cheers