# win\_service play fails when run without an optional parameter

**URL:** <https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429>\
**Category:** Ansible Project\
**Created:** [August 31, 2016, 1:12pm UTC](https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429 "2016-08-31T13:12:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dyioulos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dyioulos/32/8363_2.png) [@dyioulos](https://forum.ansible.com/u/dyioulos)\
**Post date:** [August 31, 2016, 1:12pm UTC](https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429/1 "2016-08-31T13:12:17Z")

</div>

All,

I’m running version 2.1.1, and have a very simple play to restart a service on my Win2k8 and Win2k12 servers:

---

<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:** [September 1, 2016, 7:20am UTC](https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429/2 "2016-09-01T07:20:09Z")

</div>

Hi,

I wonder if you are somehow picking up an old version of the modules, as I just checked (latest devel 2.2 version and

If ($params.start\_mode) {

is no longer in the code.

If you are running from source ensure you have done a git submodule update --init and a source hacking/env-setup otherwise you may pick up older versions of the modules installed elsewhere on your system.

If it isn’t something to do with picking up an old version of win\_service.ps1 reply back and I’ll have another think what could be causing this.

Hope this helps,

Jon

---

<div class="post-metadata">

**Author:** ![dyioulos](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dyioulos/32/8363_2.png) [@dyioulos](https://forum.ansible.com/u/dyioulos)\
**Post date:** [September 19, 2016, 6:16pm UTC](https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429/3 "2016-09-19T18:16:03Z")

</div>

Hi, Jon.

Sorry for the long delay in responding.

It may well be that an old version of the module is being picked up. There are two, one in core (dated July, 2016), the other one in extras (dated March, 2015). I guess this module made it into core. If I delete the version in extras, will that solve the problem. This is an RPM install.

Dimitri

---

<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:** [September 22, 2016, 7:02am UTC](https://forum.ansible.com/t/win-service-play-fails-when-run-without-an-optional-parameter/22429/4 "2016-09-22T07:02:43Z")

</div>

I would definitely clean up your installation and try again - you definitely only need one version of the module. I wonder perhaps if you have a source installation or a pip installation as well as an RPM install?
