|
|
@ -27,14 +27,19 @@ options:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- When C(present), ensures that the address list and entries exists.
|
|
|
|
- When C(present), ensures that the address list and entries exists.
|
|
|
|
- When C(absent), ensures the address list is removed.
|
|
|
|
- When C(absent), ensures the address list is removed.
|
|
|
|
default: present
|
|
|
|
type: str
|
|
|
|
choices:
|
|
|
|
choices:
|
|
|
|
- present
|
|
|
|
- present
|
|
|
|
- absent
|
|
|
|
- absent
|
|
|
|
|
|
|
|
default: present
|
|
|
|
version:
|
|
|
|
version:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies to which Simple Network Management Protocol (SNMP) version the trap destination applies.
|
|
|
|
- Specifies to which Simple Network Management Protocol (SNMP) version the trap destination applies.
|
|
|
|
choices: ['v1', 'v2c', 'v3']
|
|
|
|
type: str
|
|
|
|
|
|
|
|
choices:
|
|
|
|
|
|
|
|
- v1
|
|
|
|
|
|
|
|
- v2c
|
|
|
|
|
|
|
|
- v3
|
|
|
|
default: v2c
|
|
|
|
default: v2c
|
|
|
|
name:
|
|
|
|
name:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -42,11 +47,13 @@ options:
|
|
|
|
- When C(version) is C(v1) or C(v2c), this parameter is required.
|
|
|
|
- When C(version) is C(v1) or C(v2c), this parameter is required.
|
|
|
|
- The name C(public) is a reserved name on the BIG-IP. This module handles that name differently
|
|
|
|
- The name C(public) is a reserved name on the BIG-IP. This module handles that name differently
|
|
|
|
than others. Functionally, you should not see a difference however.
|
|
|
|
than others. Functionally, you should not see a difference however.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
community:
|
|
|
|
community:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the community string (password) for access to the MIB.
|
|
|
|
- Specifies the community string (password) for access to the MIB.
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
source:
|
|
|
|
source:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the source address for access to the MIB.
|
|
|
|
- Specifies the source address for access to the MIB.
|
|
|
@ -59,23 +66,27 @@ options:
|
|
|
|
- This parameter should be provided when C(state) is C(absent), so that the correct community
|
|
|
|
- This parameter should be provided when C(state) is C(absent), so that the correct community
|
|
|
|
is removed. To remove the C(public) SNMP community that comes with a BIG-IP, this parameter
|
|
|
|
is removed. To remove the C(public) SNMP community that comes with a BIG-IP, this parameter
|
|
|
|
should be set to C(default).
|
|
|
|
should be set to C(default).
|
|
|
|
|
|
|
|
type: str
|
|
|
|
port:
|
|
|
|
port:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the port for the trap destination.
|
|
|
|
- Specifies the port for the trap destination.
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
|
|
|
|
type: int
|
|
|
|
oid:
|
|
|
|
oid:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the object identifier (OID) for the record.
|
|
|
|
- Specifies the object identifier (OID) for the record.
|
|
|
|
- When C(version) is C(v3), this parameter is required.
|
|
|
|
- When C(version) is C(v3), this parameter is required.
|
|
|
|
- When C(version) is either C(v1) or C(v2c), if this value is specified, then C(source)
|
|
|
|
- When C(version) is either C(v1) or C(v2c), if this value is specified, then C(source)
|
|
|
|
must not be set to C(all).
|
|
|
|
must not be set to C(all).
|
|
|
|
|
|
|
|
type: str
|
|
|
|
access:
|
|
|
|
access:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the user's access level to the MIB.
|
|
|
|
- Specifies the user's access level to the MIB.
|
|
|
|
- When creating a new community, if this parameter is not specified, the default is C(ro).
|
|
|
|
- When creating a new community, if this parameter is not specified, the default is C(ro).
|
|
|
|
- When C(ro), specifies that the user can view the MIB, but cannot modify the MIB.
|
|
|
|
- When C(ro), specifies that the user can view the MIB, but cannot modify the MIB.
|
|
|
|
- When C(rw), specifies that the user can view and modify the MIB.
|
|
|
|
- When C(rw), specifies that the user can view and modify the MIB.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
choices:
|
|
|
|
choices:
|
|
|
|
- ro
|
|
|
|
- ro
|
|
|
|
- rw
|
|
|
|
- rw
|
|
|
@ -88,7 +99,10 @@ options:
|
|
|
|
be used.
|
|
|
|
be used.
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
- This parameter is only relevant when C(version) is C(v1), or C(v2c). If C(version) is
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
something else, this parameter is ignored.
|
|
|
|
choices: ['4', '6']
|
|
|
|
type: str
|
|
|
|
|
|
|
|
choices:
|
|
|
|
|
|
|
|
- '4'
|
|
|
|
|
|
|
|
- '6'
|
|
|
|
snmp_username:
|
|
|
|
snmp_username:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the name of the user for whom you want to grant access to the SNMP v3 MIB.
|
|
|
|
- Specifies the name of the user for whom you want to grant access to the SNMP v3 MIB.
|
|
|
@ -96,6 +110,7 @@ options:
|
|
|
|
else, this parameter is ignored.
|
|
|
|
else, this parameter is ignored.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- This parameter cannot be changed once it has been set.
|
|
|
|
- This parameter cannot be changed once it has been set.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
snmp_auth_protocol:
|
|
|
|
snmp_auth_protocol:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the authentication method for the user.
|
|
|
|
- Specifies the authentication method for the user.
|
|
|
@ -104,6 +119,7 @@ options:
|
|
|
|
- When C(none), specifies that user does not require authentication.
|
|
|
|
- When C(none), specifies that user does not require authentication.
|
|
|
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the default
|
|
|
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the default
|
|
|
|
of C(sha) will be used.
|
|
|
|
of C(sha) will be used.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
choices:
|
|
|
|
choices:
|
|
|
|
- md5
|
|
|
|
- md5
|
|
|
|
- sha
|
|
|
|
- sha
|
|
|
@ -113,6 +129,7 @@ options:
|
|
|
|
- Specifies the password for the user.
|
|
|
|
- Specifies the password for the user.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- This value must be at least 8 characters long.
|
|
|
|
- This value must be at least 8 characters long.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
snmp_privacy_protocol:
|
|
|
|
snmp_privacy_protocol:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Specifies the encryption protocol.
|
|
|
|
- Specifies the encryption protocol.
|
|
|
@ -123,6 +140,7 @@ options:
|
|
|
|
- When C(none), specifies that the system does not encrypt the user information.
|
|
|
|
- When C(none), specifies that the system does not encrypt the user information.
|
|
|
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the
|
|
|
|
- When creating a new SNMP C(v3) community, if this parameter is not specified, the
|
|
|
|
default of C(aes) will be used.
|
|
|
|
default of C(aes) will be used.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
choices:
|
|
|
|
choices:
|
|
|
|
- aes
|
|
|
|
- aes
|
|
|
|
- des
|
|
|
|
- des
|
|
|
@ -132,17 +150,20 @@ options:
|
|
|
|
- Specifies the password for the user.
|
|
|
|
- Specifies the password for the user.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- When creating a new SNMP C(v3) community, this parameter is required.
|
|
|
|
- This value must be at least 8 characters long.
|
|
|
|
- This value must be at least 8 characters long.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
update_password:
|
|
|
|
update_password:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- C(always) will allow to update passwords if the user chooses to do so.
|
|
|
|
- C(always) will allow to update passwords if the user chooses to do so.
|
|
|
|
C(on_create) will only set the password for newly created resources.
|
|
|
|
C(on_create) will only set the password for newly created resources.
|
|
|
|
default: always
|
|
|
|
type: str
|
|
|
|
choices:
|
|
|
|
choices:
|
|
|
|
- always
|
|
|
|
- always
|
|
|
|
- on_create
|
|
|
|
- on_create
|
|
|
|
|
|
|
|
default: always
|
|
|
|
partition:
|
|
|
|
partition:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Device partition to manage resources on.
|
|
|
|
- Device partition to manage resources on.
|
|
|
|
|
|
|
|
type: str
|
|
|
|
default: Common
|
|
|
|
default: Common
|
|
|
|
extends_documentation_fragment: f5
|
|
|
|
extends_documentation_fragment: f5
|
|
|
|
author:
|
|
|
|
author:
|
|
|
@ -253,20 +274,14 @@ try:
|
|
|
|
from library.module_utils.network.f5.bigip import F5RestClient
|
|
|
|
from library.module_utils.network.f5.bigip import F5RestClient
|
|
|
|
from library.module_utils.network.f5.common import F5ModuleError
|
|
|
|
from library.module_utils.network.f5.common import F5ModuleError
|
|
|
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
|
|
|
from library.module_utils.network.f5.common import AnsibleF5Parameters
|
|
|
|
from library.module_utils.network.f5.common import cleanup_tokens
|
|
|
|
|
|
|
|
from library.module_utils.network.f5.common import f5_argument_spec
|
|
|
|
from library.module_utils.network.f5.common import f5_argument_spec
|
|
|
|
from library.module_utils.network.f5.common import transform_name
|
|
|
|
from library.module_utils.network.f5.common import transform_name
|
|
|
|
from library.module_utils.network.f5.common import exit_json
|
|
|
|
|
|
|
|
from library.module_utils.network.f5.common import fail_json
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
except ImportError:
|
|
|
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
|
|
|
from ansible.module_utils.network.f5.bigip import F5RestClient
|
|
|
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
|
|
|
from ansible.module_utils.network.f5.common import F5ModuleError
|
|
|
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
|
|
|
from ansible.module_utils.network.f5.common import AnsibleF5Parameters
|
|
|
|
from ansible.module_utils.network.f5.common import cleanup_tokens
|
|
|
|
|
|
|
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
|
|
|
from ansible.module_utils.network.f5.common import f5_argument_spec
|
|
|
|
from ansible.module_utils.network.f5.common import transform_name
|
|
|
|
from ansible.module_utils.network.f5.common import transform_name
|
|
|
|
from ansible.module_utils.network.f5.common import exit_json
|
|
|
|
|
|
|
|
from ansible.module_utils.network.f5.common import fail_json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
@ -520,7 +535,7 @@ class ModuleManager(object):
|
|
|
|
class BaseManager(object):
|
|
|
|
class BaseManager(object):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
self.module = kwargs.get('module', None)
|
|
|
|
self.module = kwargs.get('module', None)
|
|
|
|
self.client = kwargs.get('client', None)
|
|
|
|
self.client = F5RestClient(**self.module.params)
|
|
|
|
self.want = ModuleParameters(params=self.module.params)
|
|
|
|
self.want = ModuleParameters(params=self.module.params)
|
|
|
|
self.have = ApiParameters()
|
|
|
|
self.have = ApiParameters()
|
|
|
|
self.changes = UsableChanges()
|
|
|
|
self.changes = UsableChanges()
|
|
|
@ -892,16 +907,12 @@ def main():
|
|
|
|
required_if=spec.required_if
|
|
|
|
required_if=spec.required_if
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
client = F5RestClient(**module.params)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
mm = ModuleManager(module=module, client=client)
|
|
|
|
mm = ModuleManager(module=module)
|
|
|
|
results = mm.exec_module()
|
|
|
|
results = mm.exec_module()
|
|
|
|
cleanup_tokens(client)
|
|
|
|
module.exit_json(**results)
|
|
|
|
exit_json(module, results, client)
|
|
|
|
|
|
|
|
except F5ModuleError as ex:
|
|
|
|
except F5ModuleError as ex:
|
|
|
|
cleanup_tokens(client)
|
|
|
|
module.fail_json(msg=str(ex))
|
|
|
|
fail_json(module, ex, client)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
if __name__ == '__main__':
|
|
|
|