<p>It's deprecated in favor of <em>started</em>.</p>

<pre><code>TASK [Test postfix is running] 
**************************************************************
[DEPRECATION WARNING]: state=running is deprecated. Please use 
state=started. This feature will be removed in version 2.7. 
Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
</code></pre>

CC BY-SA 4.0
2018-06-20T07:01:34.213Z
Thank you .. just to be sure what version of ansible are you using ? ( I'm using 2.5 and I'm not getting this message ; deprecation_warnings is not disabled in conf)
storm
CC BY-SA 4.0
2018-06-20T10:56:52.120Z
It's version 2.5.1 at Ubuntu 18.04 (ansible 2.5.1+dfsg-1).
Vladimir Botka
CC BY-SA 4.0
2018-06-19T18:44:30.053Z
2018-06-19T18:44:30.053Z
Vladimir Botka
<p>Ansible v2.5 introduced a new "running" state for the service module, <a href="https://docs.ansible.com/ansible/latest/modules/service_module.html#parameters" rel="nofollow noreferrer">the doc</a> is not saying anything about it.</p>

<blockquote>
  <p><strong>started/stopped</strong> are idempotent actions that will not run commands unless necessary. <strong>restarted</strong> will always bounce the service. <strong>reloaded</strong> will always reload. At least one of state and enabled are required. Note that <strong>reloaded</strong> will start the service if it is not already started, even if your chosen init system wouldn't normally.</p>
</blockquote>

<p>I presume it checks if the service is running and starts it if not, but this is exactly what the started state does.</p>

<p>What differs the running state from the started state ?</p>

CC BY-SA 4.0
2018-06-19T11:11:01.597Z
[From the code](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/system/service.py#L323) I assume it is just a cosmetic addition to match systemd language. (Mostly I think only someone deeply involved in ansible dev can answer, so it would be better asked on [ansible-devel mailing list](https://groups.google.com/forum/#!forum/ansible-devel)
Tensibai
<ansible>
Ansible service module running state utility
storm
# Ansible service module running state utility

(Asked by: username_0 on 2018-06-19)

Ansible v2.5 introduced a new "running" state for the service module, [the doc](https://docs.ansible.com/ansible/latest/modules/service_module.html#parameters) is not saying anything about it.

> **started/stopped** are idempotent actions that will not run commands unless necessary. **restarted** will always bounce the service. **reloaded** will always reload. At least one of state and enabled are required. Note that **reloaded** will start the service if it is not already started, even if your chosen init system wouldn't normally.

I presume it checks if the service is running and starts it if not, but this is exactly what the started state does.

What differs the running state from the started state ?

**Tags:** ansible

> **Comments:**
> **username_1**: [From the code](https://github.com/ansible/ansible/blob/devel/lib/ansible/modules/system/service.py#L323) I assume it is just a cosmetic addition to match systemd language. (Mostly I think only someone deeply involved in ansible dev can answer, so it would be better asked on [ansible-devel mailing list](https://groups.google.com/forum/#!forum/ansible-devel)  

---

## 1 answers

### Answer by username_2 on 2018-06-19. Score: 5 | Accepted answer

It's deprecated in favor of started.
TASK [Test postfix is running] 
**************************************************************
[DEPRECATION WARNING]: state=running is deprecated. Please use 
state=started. This feature will be removed in version 2.7. 
Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.

> **Comments:**
> **username_0**: Thank you .. just to be sure what version of ansible are you using ? ( I'm using 2.5 and I'm not getting this message ; deprecation_warnings is not disabled in conf)  
> **username_2**: It's version 2.5.1 at Ubuntu 18.04 (ansible 2.5.1+dfsg-1).  

---

