diff --git a/lib/ansible/modules/network/f5/bigiq_application_fasthttp.py b/lib/ansible/modules/network/f5/bigiq_application_fasthttp.py index 04d3822b846..effe694600f 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_fasthttp.py +++ b/lib/ansible/modules/network/f5/bigiq_application_fasthttp.py @@ -91,6 +91,11 @@ options: choices: - absent - 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 notes: - 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: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def has_no_service_environment(self): @@ -605,11 +611,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -710,6 +717,7 @@ class ArgumentSpec(object): default='present', choices=['present', 'absent'] ), + wait=dict(type='bool', default='yes') ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) diff --git a/lib/ansible/modules/network/f5/bigiq_application_fastl4_tcp.py b/lib/ansible/modules/network/f5/bigiq_application_fastl4_tcp.py index 2dd7fc26b92..82fb5e9a099 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_fastl4_tcp.py +++ b/lib/ansible/modules/network/f5/bigiq_application_fastl4_tcp.py @@ -91,6 +91,11 @@ options: choices: - absent - 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 notes: - 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: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def create(self): @@ -552,11 +558,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -657,6 +664,7 @@ class ArgumentSpec(object): default='present', choices=['present', 'absent'] ), + wait=dict(type='bool', default='yes') ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) diff --git a/lib/ansible/modules/network/f5/bigiq_application_fastl4_udp.py b/lib/ansible/modules/network/f5/bigiq_application_fastl4_udp.py index 2eb4355be33..50c6d7f36cf 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_fastl4_udp.py +++ b/lib/ansible/modules/network/f5/bigiq_application_fastl4_udp.py @@ -91,6 +91,11 @@ options: choices: - absent - 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 notes: - 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: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def create(self): @@ -552,11 +558,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -657,6 +664,7 @@ class ArgumentSpec(object): default='present', choices=['present', 'absent'] ), + wait=dict(type='bool', default='yes') ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) diff --git a/lib/ansible/modules/network/f5/bigiq_application_http.py b/lib/ansible/modules/network/f5/bigiq_application_http.py index e444b634a07..bbae1a95848 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_http.py +++ b/lib/ansible/modules/network/f5/bigiq_application_http.py @@ -91,6 +91,11 @@ options: choices: - absent - 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 notes: - 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: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def has_no_service_environment(self): @@ -605,11 +611,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -710,6 +717,7 @@ class ArgumentSpec(object): default='present', choices=['present', 'absent'] ), + wait=dict(type='bool', default='yes') ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) diff --git a/lib/ansible/modules/network/f5/bigiq_application_https_offload.py b/lib/ansible/modules/network/f5/bigiq_application_https_offload.py index d3812505c5c..0314779aeee 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_https_offload.py +++ b/lib/ansible/modules/network/f5/bigiq_application_https_offload.py @@ -150,6 +150,11 @@ options: choices: - absent - 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 author: - Tim Rupp (@caphrim007) @@ -788,9 +793,10 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def has_no_service_environment(self): @@ -821,11 +827,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -947,6 +954,7 @@ class ArgumentSpec(object): ) ), add_analytics=dict(type='bool', default='no'), + wait=dict(type='bool', default='yes') ) self.argument_spec = {} self.argument_spec.update(f5_argument_spec) diff --git a/lib/ansible/modules/network/f5/bigiq_application_https_waf.py b/lib/ansible/modules/network/f5/bigiq_application_https_waf.py index b6780a78843..ce3a67082f0 100644 --- a/lib/ansible/modules/network/f5/bigiq_application_https_waf.py +++ b/lib/ansible/modules/network/f5/bigiq_application_https_waf.py @@ -155,6 +155,11 @@ options: choices: - absent - 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 author: - Tim Rupp (@caphrim007) @@ -811,9 +816,10 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.remove_from_device() - self.wait_for_apply_template_task(self_link) - if self.exists(): - raise F5ModuleError("Failed to delete the resource.") + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if self.exists(): + raise F5ModuleError("Failed to delete the resource.") return True def has_no_service_environment(self): @@ -848,11 +854,12 @@ class ModuleManager(object): if self.module.check_mode: return True self_link = self.create_on_device() - self.wait_for_apply_template_task(self_link) - if not self.exists(): - raise F5ModuleError( - "Failed to deploy application." - ) + if self.want.wait: + self.wait_for_apply_template_task(self_link) + if not self.exists(): + raise F5ModuleError( + "Failed to deploy application." + ) return True def create_on_device(self): @@ -974,7 +981,8 @@ class ArgumentSpec(object): ) ), 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.update(f5_argument_spec)