4

Ansible v2.5 introduced a new "running" state for the service module, the doc 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 ?

storm
  • 1,759
  • 3
  • 15
  • 34

1 Answers1

5

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.
Vladimir Botka
  • 1,946
  • 6
  • 12
  • 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 Jun 20 '18 at 07:01
  • 1
    It's version 2.5.1 at Ubuntu 18.04 (ansible 2.5.1+dfsg-1). – Vladimir Botka Jun 20 '18 at 10:56