# Not all services being stopped

**URL:** <https://forum.ansible.com/t/not-all-services-being-stopped/11380>\
**Category:** Ansible Project\
**Created:** [March 29, 2012, 1:16pm UTC](https://forum.ansible.com/t/not-all-services-being-stopped/11380 "2012-03-29T13:16:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [March 29, 2012, 1:16pm UTC](https://forum.ansible.com/t/not-all-services-being-stopped/11380/1 "2012-03-29T13:16:33Z")

</div>

Hi

An extract from a playbook:

- name: Stop 389 services  
action: service name=dirsrv-admin state=stopped  
action: service name=dirsrv state=stopped

The log:  
TASK: [Stop 389 services] \*\*\*\*\*\*\*\*\*

ok: [[auth01.example.com](http://auth01.example.com)] =\> service name=dirsrv state=stopped

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

[auth01.example.com](http://auth01.example.com) : ok= 2 changed= 1 unreachable= 0 failed= 0

For some reason dirsrv-admin does not get stopped.

doing it manually:  
ansible [auth01.example.com](http://auth01.example.com) -m service -a “name=dirsrv-admin state=stopped”  
does work, so not sure why it fails in the playbook. Thoughts?

Regards

---

<div class="post-metadata">

**Author:** ![Seth\_Vidal](https://avatars.discourse-cdn.com/v4/letter/s/7ba0ec/32.png) [@Seth\_Vidal](https://forum.ansible.com/u/Seth_Vidal)\
**Post date:** [March 29, 2012, 1:19pm UTC](https://forum.ansible.com/t/not-all-services-being-stopped/11380/2 "2012-03-29T13:19:35Z")

</div>

I noticed something like this.

If you change:

&nbsp;&nbsp;&nbsp;- name: Stop 389 services  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: service name=dirsrv-admin state=stopped  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: service name=dirsrv state=stopped

to

&nbsp;&nbsp;&nbsp;- name: Stop 389-admin services  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: service name=dirsrv-admin state=stopped  
&nbsp;&nbsp;&nbsp;- name: stop dirsrv  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;action: service name=dirsrv state=stopped

I bet it starts working. I think the 'accept to action statements w/o a  
name' is just taking the last action statement.

I've not had a chance to look at the code yet to figure out why but I  
noticed it yesterday in testing a playbook.

-sv

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [March 29, 2012, 1:37pm UTC](https://forum.ansible.com/t/not-all-services-being-stopped/11380/3 "2012-03-29T13:37:28Z")

</div>

Actually, I think your syntax is wrong.

- name:  
action:
- action:
- action:

Is (technically) correct, but you’re specifying the same hash key twice, which is only one action. There is no way to specify one name for more than one action.

---

<div class="post-metadata">

**Author:** ![Gerhardus\_Geldenhuis](https://avatars.discourse-cdn.com/v4/letter/g/db5fbb/32.png) [@Gerhardus\_Geldenhuis](https://forum.ansible.com/u/Gerhardus_Geldenhuis)\
**Post date:** [March 29, 2012, 1:40pm UTC](https://forum.ansible.com/t/not-all-services-being-stopped/11380/4 "2012-03-29T13:40:00Z")

</div>

Damm, I will fix my syntax. Would have been nice.

Regards
