mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make state=running work for backwards compatibility with 1.8
This commit is contained in:
parent
1946f05baf
commit
2e93f8e9f7
1 changed files with 6 additions and 2 deletions
|
@ -1438,7 +1438,7 @@ def main():
|
||||||
env = dict(type='dict'),
|
env = dict(type='dict'),
|
||||||
dns = dict(),
|
dns = dict(),
|
||||||
detach = dict(default=True, type='bool'),
|
detach = dict(default=True, type='bool'),
|
||||||
state = dict(default='started', choices=['present', 'started', 'reloaded', 'restarted', 'stopped', 'killed', 'absent']),
|
state = dict(default='started', choices=['present', 'started', 'reloaded', 'restarted', 'stopped', 'killed', 'absent', 'running']),
|
||||||
restart_policy = dict(default=None, choices=['always', 'on-failure', 'no']),
|
restart_policy = dict(default=None, choices=['always', 'on-failure', 'no']),
|
||||||
restart_policy_retry = dict(default=0, type='int'),
|
restart_policy_retry = dict(default=0, type='int'),
|
||||||
debug = dict(default=False, type='bool'),
|
debug = dict(default=False, type='bool'),
|
||||||
|
@ -1460,12 +1460,16 @@ def main():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
manager = DockerManager(module)
|
manager = DockerManager(module)
|
||||||
state = module.params.get('state')
|
|
||||||
count = int(module.params.get('count'))
|
count = int(module.params.get('count'))
|
||||||
name = module.params.get('name')
|
name = module.params.get('name')
|
||||||
image = module.params.get('image')
|
image = module.params.get('image')
|
||||||
pull = module.params.get('pull')
|
pull = module.params.get('pull')
|
||||||
|
|
||||||
|
state = module.params.get('state')
|
||||||
|
if state == 'running':
|
||||||
|
# Renamed running to started in 1.9
|
||||||
|
state = 'started'
|
||||||
|
|
||||||
if count < 0:
|
if count < 0:
|
||||||
module.fail_json(msg="Count must be greater than zero")
|
module.fail_json(msg="Count must be greater than zero")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue