# need to pull value from mysql (or elsewhere) as a variable

**URL:** <https://forum.ansible.com/t/need-to-pull-value-from-mysql-or-elsewhere-as-a-variable/22056>\
**Category:** Ansible Project\
**Created:** [July 20, 2016, 12:14pm UTC](https://forum.ansible.com/t/need-to-pull-value-from-mysql-or-elsewhere-as-a-variable/22056 "2016-07-20T12:14:05Z")\
**Posts on this page:** 2\
**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 20, 2016, 12:14pm UTC](https://forum.ansible.com/t/need-to-pull-value-from-mysql-or-elsewhere-as-a-variable/22056/1 "2016-07-20T12:14:05Z")

</div>

The servers here have nfs-mounted volumes. I need to get that volume name (stored in mysql) and make a symlink to it. Any idea how to accomplish this without manual intervention?

Thanks!

---

<div class="post-metadata">

**Author:** ![Mark\_Phillips](https://avatars.discourse-cdn.com/v4/letter/m/73ab20/32.png) [@Mark\_Phillips](https://forum.ansible.com/u/Mark_Phillips)\
**Post date:** [July 20, 2016, 8:47pm UTC](https://forum.ansible.com/t/need-to-pull-value-from-mysql-or-elsewhere-as-a-variable/22056/2 "2016-07-20T20:47:28Z")

</div>

Hello,

You could use a lookup or command to run a mysql query.

Although not specifically what you’re looking for, this example does go to somewhere remote to get a value…

[https://github.com/phips/ansible-demos/blob/master/roles/app/tasks/main.yml#L11](https://github.com/phips/ansible-demos/blob/master/roles/app/tasks/main.yml#L11)

Cheers,

–Mark
