-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
community.mysql.mysql_db appears not to support relative paths when importing databases #395
Comments
@chriscroome hello again and thanks for reporting this! Adding the new option sounds good to me @bmalynovytch @rsicart @Jorge-Rodriguez @betanummeric what do you folks think? If you're OK with this, does anyone want to implement this? |
@chriscroome i created a PR #396, could you please take a look? |
@chriscroome the PR has been reviewed and merged, thanks for the contribution! |
No problem, did you consider making changing to the directory that the file to be imported resides in the default behaviour? |
thanks for the idea! |
I think it would only be a breaking change if a SQL dump file anticipated the default working directory and had paths relative to that wouldn't it? That seems like a fairly unlikely scenario since this varies doesn't it (please correct me if I'm wrong)? |
The |
@betanummeric what is the default working directory? I was working under the assumption that is isn't always the same for all connections to all servers so nobody will be using path relative to it, but perhaps I have got this wrong? |
@betanummeric great catch about the cert and other arguments, thanks! |
As far as I know the default working directory is the home of the linux user as whom ansible connects to the target system. Relative paths could be used in theory, but I cannot speak from experience. |
The MariaDB sys schema cannot be imported using
community.mysql.mysql_db
, for example this Ansible:Fails with:
I suspect this is because relative links are used in the SQL, for example:
The
ansible.builtin.shell
module can be used since is supportschdir
, for example:Could adding support for
cd
'ing into to the directory that contains the file to be imported or adding achdir
option to the module be considered as a feature request to solve this problem?The text was updated successfully, but these errors were encountered: