# service\_facts gathering the wrong status

**URL:** <https://forum.ansible.com/t/service-facts-gathering-the-wrong-status/29418>\
**Category:** Ansible Project\
**Created:** [January 10, 2019, 7:07pm UTC](https://forum.ansible.com/t/service-facts-gathering-the-wrong-status/29418 "2019-01-10T19:07:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francis\_Santos](https://avatars.discourse-cdn.com/v4/letter/f/49beb7/32.png) [@Francis\_Santos](https://forum.ansible.com/u/Francis_Santos)\
**Post date:** [January 10, 2019, 7:07pm UTC](https://forum.ansible.com/t/service-facts-gathering-the-wrong-status/29418/1 "2019-01-10T19:07:18Z")

</div>

Hi everyone,

I have a problem where a task has a condition to run only when the service is “running”. However when I gather the facts, it gathers the wrong status.  
How do I fix it?  
I already restart the service but it is not fixed.

ACTUAL SERVICE

● consul.service - LSB: Manage the consul server  
Loaded: loaded (/etc/rc.d/init.d/consul; bad; vendor preset: disabled)  
Active: active ( **running** ) since Thu 2019-01-10 18:32:23 GMT; 6min ago  
Docs: man:systemd-sysv-generator(8)  
Process: 17953 ExecStart=/etc/rc.d/init.d/consul start (code=exited, status=0/SUCCESS)  
Memory: 46.4M  
CGroup: /system.slice/consul.service

└─17963 /usr/local/bin/consul agent -config-dir=/etc/consul.d/server/

WHEN I GATHER FACTS

TASK [steady state] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [sj3-tl-consul05] =\> {  
“ansible\_facts.services.consul”: {  
“name”: “consul”,  
“source”: “sysv”,  
“state”: “ **stopped** ”  
}  
}
