bertvv / ansible-role-mariadb

Install MariaDB on RHEL/CentOS 7 or Fedora.
https://galaxy.ansible.com/bertvv/mariadb/
Other
144 stars 108 forks source link

multiple init scripts? #23

Closed dsclassen closed 5 years ago

dsclassen commented 5 years ago

I have a database that should be initialized with multiple sql files.

This does not work, but is there some other way to do this?

      - name: mynewdb
        init_script: "{{ item }}"
      with_items:
        - /tmp/mynewdb-database/schema/tables.sql
        - /tmp/mynewdb-database/schema/routines.sql
        - /tmp/mynewdb-database/schema/data.sql
        - /tmp/mynewdb-database/schema/lookups.sql

Thanks.

bertvv commented 5 years ago

Good suggestion, I'll see if I can implement this.

bertvv commented 5 years ago

I've looked into this, but I don't see a way right now to implement this. The way the playbook (tasks/databases.yml) now copies init scripts to the server and then executes them on the correct database is already rather complex. I don't see a way to additionaly test whether one or more init scripts were specified, copy & execute them all.

I'm sorry, but I won't be able to implement this in the foreseeable future. I'm closing this issue for now, but if you or anyone else has ideas on how to get this working, feel free to reopen, or send a Pull Request...