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 ?

1
  • 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, 2018 at 11:11

1 Answer 1

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.
2
  • 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, 2018 at 7:01
  • 1
    It's version 2.5.1 at Ubuntu 18.04 (ansible 2.5.1+dfsg-1). Jun 20, 2018 at 10:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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