Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Michael Peters
I've wanted to create a mysql_query module that would probably help with a lot of things like this. It could execute an arbitrary query and then you could register the results. Would make it easier than having to manipulate mysql command line stdout since you could use structured data. I just have

Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Michael DeHaan
"This might be a good opportunity to create a MySQL facts module that returns information about a server," While you're free to do that, not sure we want this -- Trying to control over-proliferation of ansible-facts modules if possible as here the register seems pretty easy. If it returns a giant

Re: [ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Paul Durivage
Hi Andrew, Determining how a task should be treated as "changed" is can be controlled using the changed_when directive. See the documentation: http://docs.ansible.com/playbooks_error_handling.html#overriding-the-changed-result -name: check if DB exists shell: mysql -u -p -h 'show databases;'

[ansible-project] Re: mysql_db state=import only once

2014-06-11 Thread Andrew Udvare
On Tuesday, 26 November 2013 10:15:03 UTC-8, Bruce Pennypacker wrote: > > It looks like the mysql_db module will blindly run mysqldump wiht the > specified target file if it's specified, so yes it's currently expected > behavior. > > What you would probably need to do is run an action before yo

[ansible-project] Re: mysql_db state=import only once

2013-11-26 Thread Bruce Pennypacker
It looks like the mysql_db module will blindly run mysqldump wiht the specified target file if it's specified, so yes it's currently expected behavior. What you would probably need to do is run an action before you call mysql_db that checks to see if the database already exists and register a