mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 21:00:22 -07:00
Mass nuke deprecated items that are easily removed. ci_complete (#44320)
This commit is contained in:
parent
b7139782cf
commit
617372f8c0
18 changed files with 32 additions and 396 deletions
|
@ -36,7 +36,7 @@ options:
|
|||
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.
|
||||
choices: [ reloaded, restarted, running, started, stopped ]
|
||||
choices: [ reloaded, restarted, started, stopped ]
|
||||
sleep:
|
||||
description:
|
||||
- If the service is being C(restarted) then sleep this many seconds
|
||||
|
@ -49,7 +49,7 @@ options:
|
|||
- If the service does not respond to the status command, name a
|
||||
substring to look for as would be found in the output of the I(ps)
|
||||
command as a stand-in for a status result. If the string is found,
|
||||
the service will be assumed to be running.
|
||||
the service will be assumed to be started.
|
||||
version_added: "0.7"
|
||||
enabled:
|
||||
description:
|
||||
|
@ -75,12 +75,12 @@ notes:
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
- name: Start service httpd, if not running
|
||||
- name: Start service httpd, if not started
|
||||
service:
|
||||
name: httpd
|
||||
state: started
|
||||
|
||||
- name: Stop service httpd, if running
|
||||
- name: Stop service httpd, if started
|
||||
service:
|
||||
name: httpd
|
||||
state: stopped
|
||||
|
@ -95,7 +95,7 @@ EXAMPLES = '''
|
|||
name: httpd
|
||||
state: reloaded
|
||||
|
||||
- name: Enable service httpd, and not touch the running state
|
||||
- name: Enable service httpd, and not touch the state
|
||||
service:
|
||||
name: httpd
|
||||
enabled: yes
|
||||
|
@ -316,7 +316,7 @@ class Service(object):
|
|||
if self.state and self.running is None:
|
||||
self.module.fail_json(msg="failed determining service state, possible typo of service name?")
|
||||
# Find out if state has changed
|
||||
if not self.running and self.state in ["reloaded", "running", "started"]:
|
||||
if not self.running and self.state in ["reloaded", "started"]:
|
||||
self.svc_change = True
|
||||
elif self.running and self.state in ["reloaded", "stopped"]:
|
||||
self.svc_change = True
|
||||
|
@ -330,7 +330,7 @@ class Service(object):
|
|||
# Only do something if state will change
|
||||
if self.svc_change:
|
||||
# Control service
|
||||
if self.state in ['running', 'started']:
|
||||
if self.state in ['started']:
|
||||
self.action = "start"
|
||||
elif not self.running and self.state == 'reloaded':
|
||||
self.action = "start"
|
||||
|
@ -1518,7 +1518,7 @@ def main():
|
|||
module = AnsibleModule(
|
||||
argument_spec=dict(
|
||||
name=dict(type='str', required=True),
|
||||
state=dict(type='str', choices=['running', 'started', 'stopped', 'reloaded', 'restarted']),
|
||||
state=dict(type='str', choices=['started', 'stopped', 'reloaded', 'restarted']),
|
||||
sleep=dict(type='int'),
|
||||
pattern=dict(type='str'),
|
||||
enabled=dict(type='bool'),
|
||||
|
@ -1597,7 +1597,7 @@ def main():
|
|||
else:
|
||||
# as we may have just bounced the service the service command may not
|
||||
# report accurate state at this moment so just show what we ran
|
||||
if service.module.params['state'] in ['reloaded', 'restarted', 'running', 'started']:
|
||||
if service.module.params['state'] in ['reloaded', 'restarted', 'started']:
|
||||
result['state'] = 'started'
|
||||
else:
|
||||
result['state'] = 'stopped'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue