summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Davis <mrd@redhat.com>2018-02-22 17:10:05 -0800
committerMatt Davis <mrd@redhat.com>2018-02-22 17:10:05 -0800
commit2ddcdb87208d62ee00ecabd12621e43cb4229861 (patch)
tree98f6e10c8ba81fd9372ae2695c329a51d638ef3e
parent917e5ae5d842f94f299998facd0e0657093bce8f (diff)
downloadansible-2ddcdb87208d62ee00ecabd12621e43cb4229861.tar.gz
Revert "Add force option to systemd module (#35925)"
(mistaken cherry pick) This reverts commit 9935cda4a3ba4297eeeb62d1d80c24db806094b4.
-rw-r--r--lib/ansible/modules/system/systemd.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/lib/ansible/modules/system/systemd.py b/lib/ansible/modules/system/systemd.py
index e913d35200..58c9ac6b61 100644
--- a/lib/ansible/modules/system/systemd.py
+++ b/lib/ansible/modules/system/systemd.py
@@ -33,11 +33,6 @@ options:
description:
- Whether the service should start on boot. B(At least one of state and enabled are required.)
type: bool
- force:
- description:
- - Whether to override existing symlinks.
- type: bool
- version_added: 2.6
masked:
description:
- Whether the unit should be masked or not, a masked unit is impossible to start.
@@ -70,14 +65,10 @@ requirements:
EXAMPLES = '''
- name: Make sure a service is running
- systemd:
- state: started
- name: httpd
+ systemd: state=started name=httpd
- name: stop service cron on debian, if running
- systemd:
- name: cron
- state: stopped
+ systemd: name=cron state=stopped
- name: restart service cron on centos, in all cases, also issue daemon-reload to pick up config changes
systemd:
@@ -103,8 +94,7 @@ EXAMPLES = '''
enabled: True
- name: just force systemd to reread configs (2.4 and above)
- systemd:
- daemon_reload: yes
+ systemd: daemon_reload=yes
'''
RETURN = '''
@@ -295,7 +285,6 @@ def main():
name=dict(type='str', aliases=['service', 'unit']),
state=dict(type='str', choices=['reloaded', 'restarted', 'started', 'stopped']),
enabled=dict(type='bool'),
- force=dict(type='bool'),
masked=dict(type='bool'),
daemon_reload=dict(type='bool', default=False, aliases=['daemon-reload']),
user=dict(type='bool', default=False),
@@ -310,8 +299,6 @@ def main():
systemctl = systemctl + " --user"
if module.params['no_block']:
systemctl = systemctl + " --no-block"
- if module.params['force']:
- systemctl = systemctl + " --force"
unit = module.params['name']
rc = 0
out = err = ''