mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Adds wait parameters to bigiq applications (#40420)
The wait parameter allows the module to wait or not wait when an application is created. By default the modules will wait.
This commit is contained in:
parent
1492414165
commit
5af91ef407
6 changed files with 97 additions and 49 deletions
|
@ -91,6 +91,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
notes:
|
notes:
|
||||||
- This module does not support updating of your application (whether deployed or not).
|
- This module does not support updating of your application (whether deployed or not).
|
||||||
|
@ -572,9 +577,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_no_service_environment(self):
|
def has_no_service_environment(self):
|
||||||
|
@ -605,11 +611,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -710,6 +717,7 @@ class ArgumentSpec(object):
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent']
|
choices=['present', 'absent']
|
||||||
),
|
),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
|
@ -91,6 +91,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
notes:
|
notes:
|
||||||
- This module does not support updating of your application (whether deployed or not).
|
- This module does not support updating of your application (whether deployed or not).
|
||||||
|
@ -530,9 +535,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
|
@ -552,11 +558,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -657,6 +664,7 @@ class ArgumentSpec(object):
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent']
|
choices=['present', 'absent']
|
||||||
),
|
),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
|
@ -91,6 +91,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
notes:
|
notes:
|
||||||
- This module does not support updating of your application (whether deployed or not).
|
- This module does not support updating of your application (whether deployed or not).
|
||||||
|
@ -530,9 +535,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create(self):
|
def create(self):
|
||||||
|
@ -552,11 +558,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -657,6 +664,7 @@ class ArgumentSpec(object):
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent']
|
choices=['present', 'absent']
|
||||||
),
|
),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
|
@ -91,6 +91,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
notes:
|
notes:
|
||||||
- This module does not support updating of your application (whether deployed or not).
|
- This module does not support updating of your application (whether deployed or not).
|
||||||
|
@ -572,9 +577,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_no_service_environment(self):
|
def has_no_service_environment(self):
|
||||||
|
@ -605,11 +611,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -710,6 +717,7 @@ class ArgumentSpec(object):
|
||||||
default='present',
|
default='present',
|
||||||
choices=['present', 'absent']
|
choices=['present', 'absent']
|
||||||
),
|
),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
|
@ -150,6 +150,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -788,9 +793,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_no_service_environment(self):
|
def has_no_service_environment(self):
|
||||||
|
@ -821,11 +827,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -947,6 +954,7 @@ class ArgumentSpec(object):
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
add_analytics=dict(type='bool', default='no'),
|
add_analytics=dict(type='bool', default='no'),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
|
@ -155,6 +155,11 @@ options:
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- present
|
- present
|
||||||
|
wait:
|
||||||
|
description:
|
||||||
|
- If the module should wait for the application to be created, deleted or updated.
|
||||||
|
type: bool
|
||||||
|
default: yes
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
- Tim Rupp (@caphrim007)
|
- Tim Rupp (@caphrim007)
|
||||||
|
@ -811,9 +816,10 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.remove_from_device()
|
self_link = self.remove_from_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError("Failed to delete the resource.")
|
if self.exists():
|
||||||
|
raise F5ModuleError("Failed to delete the resource.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def has_no_service_environment(self):
|
def has_no_service_environment(self):
|
||||||
|
@ -848,11 +854,12 @@ class ModuleManager(object):
|
||||||
if self.module.check_mode:
|
if self.module.check_mode:
|
||||||
return True
|
return True
|
||||||
self_link = self.create_on_device()
|
self_link = self.create_on_device()
|
||||||
self.wait_for_apply_template_task(self_link)
|
if self.want.wait:
|
||||||
if not self.exists():
|
self.wait_for_apply_template_task(self_link)
|
||||||
raise F5ModuleError(
|
if not self.exists():
|
||||||
"Failed to deploy application."
|
raise F5ModuleError(
|
||||||
)
|
"Failed to deploy application."
|
||||||
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def create_on_device(self):
|
def create_on_device(self):
|
||||||
|
@ -974,7 +981,8 @@ class ArgumentSpec(object):
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
add_analytics=dict(type='bool', default='no'),
|
add_analytics=dict(type='bool', default='no'),
|
||||||
domain_names=dict(type='list')
|
domain_names=dict(type='list'),
|
||||||
|
wait=dict(type='bool', default='yes')
|
||||||
)
|
)
|
||||||
self.argument_spec = {}
|
self.argument_spec = {}
|
||||||
self.argument_spec.update(f5_argument_spec)
|
self.argument_spec.update(f5_argument_spec)
|
||||||
|
|
Loading…
Reference in a new issue