mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
parent
fd2e0ddcac
commit
48704d45fd
10 changed files with 21 additions and 20 deletions
|
@ -35,15 +35,16 @@ options:
|
||||||
versions of BIG-IP. The opposite, however, is true; you can import older into
|
versions of BIG-IP. The opposite, however, is true; you can import older into
|
||||||
newer.
|
newer.
|
||||||
- The file format can be binary of XML.
|
- The file format can be binary of XML.
|
||||||
|
type: path
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- When set to C(yes) any existing policy with the same name will be overwritten by the new import.
|
- When set to C(yes) any existing policy with the same name will be overwritten by the new import.
|
||||||
- Works in both inline and file imports, if policy does not exist this setting is ignored.
|
- Works for both inline and file imports, if the policy does not exist this setting is ignored.
|
||||||
default: no
|
default: no
|
||||||
type: bool
|
type: bool
|
||||||
partition:
|
partition:
|
||||||
description:
|
description:
|
||||||
- Device partition to manage resources on.
|
- Device partition to create policy on.
|
||||||
default: Common
|
default: Common
|
||||||
extends_documentation_fragment: f5
|
extends_documentation_fragment: f5
|
||||||
author:
|
author:
|
||||||
|
@ -84,8 +85,8 @@ EXAMPLES = r'''
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = r'''
|
RETURN = r'''
|
||||||
file:
|
source:
|
||||||
description: Local path to ASM policy file.
|
description: Local path to an ASM policy file.
|
||||||
returned: changed
|
returned: changed
|
||||||
type: str
|
type: str
|
||||||
sample: /root/some_policy.xml
|
sample: /root/some_policy.xml
|
||||||
|
@ -365,10 +366,10 @@ class ModuleManager(object):
|
||||||
|
|
||||||
if response['status'] == 'FAILURE':
|
if response['status'] == 'FAILURE':
|
||||||
raise F5ModuleError(
|
raise F5ModuleError(
|
||||||
'Failed to export ASM policy.'
|
'Failed to import ASM policy.'
|
||||||
)
|
)
|
||||||
if response['status'] == 'COMPLETED':
|
if response['status'] == 'COMPLETED':
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def import_file_to_device(self):
|
def import_file_to_device(self):
|
||||||
name = os.path.split(self.want.source)[1]
|
name = os.path.split(self.want.source)[1]
|
||||||
|
|
|
@ -351,7 +351,7 @@ class ModuleParameters(Parameters):
|
||||||
return self._values['name']
|
return self._values['name']
|
||||||
|
|
||||||
if self._signature_set_exists_on_device(self._values['name']):
|
if self._signature_set_exists_on_device(self._values['name']):
|
||||||
return self._values['name']
|
return self._values['name']
|
||||||
|
|
||||||
raise F5ModuleError(
|
raise F5ModuleError(
|
||||||
"The specified signature {0} set does not exist.".format(
|
"The specified signature {0} set does not exist.".format(
|
||||||
|
|
|
@ -283,7 +283,7 @@ class Difference(object):
|
||||||
if self.have.name_servers is None:
|
if self.have.name_servers is None:
|
||||||
return self.want.name_servers
|
return self.want.name_servers
|
||||||
if set(self.want.name_servers) != set(self.have.name_servers):
|
if set(self.want.name_servers) != set(self.have.name_servers):
|
||||||
return self.want.name_servers
|
return self.want.name_servers
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def search(self):
|
def search(self):
|
||||||
|
@ -305,7 +305,7 @@ class Difference(object):
|
||||||
if self.have.search is None:
|
if self.have.search is None:
|
||||||
return self.want.search
|
return self.want.search
|
||||||
if set(self.want.search) != set(self.have.search):
|
if set(self.want.search) != set(self.have.search):
|
||||||
return self.want.search
|
return self.want.search
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
|
|
|
@ -282,7 +282,7 @@ class Difference(object):
|
||||||
if self.have.allow is None:
|
if self.have.allow is None:
|
||||||
return self.want.allow
|
return self.want.allow
|
||||||
if set(self.want.allow) != set(self.have.allow):
|
if set(self.want.allow) != set(self.have.allow):
|
||||||
return self.want.allow
|
return self.want.allow
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
|
|
|
@ -151,8 +151,8 @@ class Parameters(AnsibleF5Parameters):
|
||||||
if self._values['name']:
|
if self._values['name']:
|
||||||
return self._values['name']
|
return self._values['name']
|
||||||
if self._values['content']:
|
if self._values['content']:
|
||||||
name = self._get_template_name()
|
name = self._get_template_name()
|
||||||
return name
|
return name
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -710,7 +710,7 @@ class Difference(object):
|
||||||
if self.have.options is None:
|
if self.have.options is None:
|
||||||
return self.want.options
|
return self.want.options
|
||||||
if set(self.want.options) != set(self.have.options):
|
if set(self.want.options) != set(self.have.options):
|
||||||
return self.want.options
|
return self.want.options
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def sni_require(self):
|
def sni_require(self):
|
||||||
|
|
|
@ -359,7 +359,7 @@ class ModuleParameters(Parameters):
|
||||||
@property
|
@property
|
||||||
def proxy_type(self):
|
def proxy_type(self):
|
||||||
if self._values['proxy_type'] is None:
|
if self._values['proxy_type'] is None:
|
||||||
return None
|
return None
|
||||||
if self._values['proxy_type'] == 'explicit':
|
if self._values['proxy_type'] == 'explicit':
|
||||||
if self.dns_resolver is None or self.dns_resolver == '':
|
if self.dns_resolver is None or self.dns_resolver == '':
|
||||||
raise F5ModuleError(
|
raise F5ModuleError(
|
||||||
|
@ -626,7 +626,7 @@ class Difference(object):
|
||||||
else:
|
else:
|
||||||
return self.want.encrypt_cookies
|
return self.want.encrypt_cookies
|
||||||
if set(self.want.encrypt_cookies) != set(self.have.encrypt_cookies):
|
if set(self.want.encrypt_cookies) != set(self.have.encrypt_cookies):
|
||||||
return self.want.encrypt_cookies
|
return self.want.encrypt_cookies
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def encrypt_cookie_secret(self):
|
def encrypt_cookie_secret(self):
|
||||||
|
|
|
@ -296,7 +296,7 @@ class Difference(object):
|
||||||
if self.content:
|
if self.content:
|
||||||
return self.want.source_path
|
return self.want.source_path
|
||||||
if self.want.source_path != self.have.source_path:
|
if self.want.source_path != self.have.source_path:
|
||||||
return self.want.source_path
|
return self.want.source_path
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def content(self):
|
def content(self):
|
||||||
|
|
|
@ -267,7 +267,7 @@ class Difference(object):
|
||||||
if self.key_checksum:
|
if self.key_checksum:
|
||||||
return self.want.key_source_path
|
return self.want.key_source_path
|
||||||
if self.want.key_source_path != self.have.key_source_path:
|
if self.want.key_source_path != self.have.key_source_path:
|
||||||
return self.want.key_source_path
|
return self.want.key_source_path
|
||||||
|
|
||||||
|
|
||||||
class ModuleManager(object):
|
class ModuleManager(object):
|
||||||
|
|
|
@ -710,7 +710,7 @@ class ModuleManager(object):
|
||||||
def virtual_disk_exists(self):
|
def virtual_disk_exists(self):
|
||||||
response = self.get_virtual_disk_on_device()
|
response = self.get_virtual_disk_on_device()
|
||||||
if response:
|
if response:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def remove_virtual_disk_from_device(self):
|
def remove_virtual_disk_from_device(self):
|
||||||
|
@ -743,7 +743,7 @@ class ModuleManager(object):
|
||||||
try:
|
try:
|
||||||
response = resp.json()
|
response = resp.json()
|
||||||
except ValueError as ex:
|
except ValueError as ex:
|
||||||
raise F5ModuleError(str(ex))
|
raise F5ModuleError(str(ex))
|
||||||
|
|
||||||
if resp.status == 404 or 'code' in response and response['code'] == 404:
|
if resp.status == 404 or 'code' in response and response['code'] == 404:
|
||||||
return True
|
return True
|
||||||
|
@ -767,7 +767,7 @@ class ModuleManager(object):
|
||||||
try:
|
try:
|
||||||
response = resp.json()
|
response = resp.json()
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return False
|
return False
|
||||||
if 'code' in response and response['code'] == 400:
|
if 'code' in response and response['code'] == 400:
|
||||||
if 'message' in response:
|
if 'message' in response:
|
||||||
raise F5ModuleError(response['message'])
|
raise F5ModuleError(response['message'])
|
||||||
|
|
Loading…
Reference in a new issue