# ansible stuck in celery

**URL:** <https://forum.ansible.com/t/ansible-stuck-in-celery/23265>\
**Category:** Ansible Project\
**Created:** [December 15, 2016, 2:37am UTC](https://forum.ansible.com/t/ansible-stuck-in-celery/23265 "2016-12-15T02:37:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hzj.zh](https://avatars.discourse-cdn.com/v4/letter/h/b9bd4f/32.png) [@hzj.zh](https://forum.ansible.com/u/hzj.zh)\
**Post date:** [December 15, 2016, 2:37am UTC](https://forum.ansible.com/t/ansible-stuck-in-celery/23265/1 "2016-12-15T02:37:09Z")

</div>

hello，all

i am using celery to run ansible-playbook , my env

- Python 2.7.5
- celery==4.0.1
- ansible 2.2.0.0
- redhat7.0

i use celery to run playbook to change passwd, the playbook task will stuck from time to time, when i kill the celery worker, then the task continues to run . i cant find any error msg in celery log file;

the only thing i can find is that the problem relates to the number of hosts in inventory,  
50 hosts may be ok, 100 hosts definitely get this problem;

anyone happened to this? the problem really frustrated me ;

this is my playbook

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [December 15, 2016, 6:45am UTC](https://forum.ansible.com/t/ansible-stuck-in-celery/23265/2 "2016-12-15T06:45:51Z")

</div>

I suggest checking your system logs to see if you are ok for resources / forks / open files etc.

What are you setting forks to (probably in your ansible.cfg if not specifed on the ansible-playbook command line? You might be asking a lot of your celery / ansible controller machine.

Jon

---

<div class="post-metadata">

**Author:** ![hzj.zh](https://avatars.discourse-cdn.com/v4/letter/h/b9bd4f/32.png) [@hzj.zh](https://forum.ansible.com/u/hzj.zh)\
**Post date:** [December 15, 2016, 9:25am UTC](https://forum.ansible.com/t/ansible-stuck-in-celery/23265/3 "2016-12-15T09:25:34Z")

</div>

i modified the nofile and nproc limit in /etc/security/limits.conf to 65535, but still not getting any better,

then i changed the forks option in ansible.cfg from 20 to 2, nothing changed;

it appears that when the stuck happens, some ansible-playbook processes become defunct

yd\_hzj 52703 52573 10 16:50 pts/21 00:00:09 ansible-playbook chpwd.yml -e {“ansible\_become\_method”: “su”, “user\_name\_lists”: …} -i hosts  
yd\_hzj 54571 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54575 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54595 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54600 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54616 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54625 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54628 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54631 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54643 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]   
yd\_hzj 54647 52703 0 16:51 pts/21 00:00:00 [ansible-playboo]

any help would be appreciated
