db module?

I'm thinking about creating a 'db' module for Ansible with the following
synopsis:

        module name: db
        args:
                init=template.j2
                dest=dbname.ext
                type={anydbm|gdbm|bdb|dbm|cdb|csv|lsearch}
                key=key
                value="whatever"
                ensure={present|absent}

type: most of these should be self-explanatory. Lsearch is typical for
Exim, for example, and is "key: value".

Thoughts?

Questions:

1. Michael added daisychaining *out* of a module into, say, 'file'
   module (see get_url and/or assemble). Is there a way to daisychain
   *from* a module? I'd very much like to be able to INITIALIZE a
   database from a template on the ansible manager. (This can of course
   be completed in two steps: 1. copy template and 2. run db module) but
   doing it all in a single step seems cleaner.
  
   Not vital, but nice to have: maybe Michael can think about this ... :slight_smile:

2. Suggestions Python modules for DB-handling? There's anydbm, gdbm,
   etc. I'd like to be able to support as many types as possible without
   requiring installation on the nodes ... Any feedback welcome.

Regards,

        -JP

Questions:

1. Michael added daisychaining *out* of a module into, say, 'file'
module (see get_url and/or assemble). Is there a way to daisychain
*from* a module? I'd very much like to be able to INITIALIZE a
database from a template on the ansible manager. (This can of course
be completed in two steps: 1. copy template and 2. run db module) but
doing it all in a single step seems cleaner.

Nope, the daisy chain stuff was called that because it allows a module to decide what to call next, but you can't in Ansible call another module from another module. The daisy chaining is useful for saying "this module creates a file, and then the file module should be able to set attributes on it", and I don't see it really being used for anything other than file. (For end users, they should never need to know this exists)

I really don't want to add this either, because the changes would be rather intrusive to the core for what is hopefully a bit of an edge case.