diff --git a/lib/ansible/modules/system/systemd.py b/lib/ansible/modules/system/systemd.py index 19fedce4a78..dcc493b812b 100644 --- a/lib/ansible/modules/system/systemd.py +++ b/lib/ansible/modules/system/systemd.py @@ -384,7 +384,10 @@ def main(): if result['status']['ActiveState'] == 'active': action = 'stop' else: - action = module.params['state'][:-2] # remove 'ed' from restarted/reloaded + if result['status']['ActiveState'] != 'active': + action = 'start' + else: + action = module.params['state'][:-2] # remove 'ed' from restarted/reloaded result['state'] = 'started' if action: