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 ?

  • 3
    From the code 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 – Tensibai Jun 19 '18 at 11:11
4

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.
  • 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 7: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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.