# Gather variables from database

**URL:** <https://forum.ansible.com/t/gather-variables-from-database/22137>\
**Category:** Ansible Project\
**Created:** [July 27, 2016, 2:50pm UTC](https://forum.ansible.com/t/gather-variables-from-database/22137 "2016-07-27T14:50:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gforster](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/gforster/32/535_2.png) [@gforster](https://forum.ansible.com/u/gforster)\
**Post date:** [July 27, 2016, 2:50pm UTC](https://forum.ansible.com/t/gather-variables-from-database/22137/1 "2016-07-27T14:50:11Z")

</div>

In setting up a brand new server that is being migrated from old server with the same (similar) name. e.g. server1 is migrating to migrate-server1. The old server has a volume name mounted to a particular dir. e.g. the volume is mounted in /mydir/myvol3. Another server may have their volume mounted in /mydir/myvol52 - they are all different volume names. I need to create the /mydir/ for each server. These volume name is available in two places - the old server and a mysql db.

How do I get the proper volume name for each server and create the correct dir so that later in the playbook I can put proper symlinks in place and mount it in fstab (I have those parts worked out)?

Right now, all I can do is a single server at a time having the playbook prompt for the volume name.

Thanks!
