# Long running DB init

**URL:** <https://forum.ansible.com/t/long-running-db-init/21055>\
**Category:** Ansible Project\
**Created:** [April 4, 2016, 6:39am UTC](https://forum.ansible.com/t/long-running-db-init/21055 "2016-04-04T06:39:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Florian\_Lohoff](https://avatars.discourse-cdn.com/v4/letter/f/7cd45c/32.png) [@Florian\_Lohoff](https://forum.ansible.com/u/Florian_Lohoff)\
**Post date:** [April 4, 2016, 6:39am UTC](https://forum.ansible.com/t/long-running-db-init/21055/1 "2016-04-04T06:39:10Z")

</div>

Hi,  
I am going my first Ansible steps (Doing cfengine for 10+ Years).

So far i am having no huge issues. I am playing with setting up  
postgres databases etc. Now i was thinking of initializing them  
with content which would take hours to days to import data.

How do others implement tasks like this? I have read about the async  
polling but was rather thinking of deploying an import script  
and just starting that.

Flo

---

<div class="post-metadata">

**Author:** ![david.hollenberger](https://avatars.discourse-cdn.com/v4/letter/d/7cd45c/32.png) [@david.hollenberger](https://forum.ansible.com/u/david.hollenberger)\
**Post date:** [April 4, 2016, 4:04pm UTC](https://forum.ansible.com/t/long-running-db-init/21055/2 "2016-04-04T16:04:24Z")

</div>

We use async/polling for our “long” running tasks (1-4 hrs) which are mainly postgres or oracle database restores. Not sure about tasks that take days, you may want to look into the “fire and forget” mode by setting poll=0. Just make sure to set async high enough to allow tasks to run that long. Ansible seems to do a really good job of ensuring those long running tasks keep running.

- David
