|
|
@ -4,13 +4,17 @@
|
|
|
|
# Copyright (c) 2017 F5 Networks Inc.
|
|
|
|
# Copyright (c) 2017 F5 Networks Inc.
|
|
|
|
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from __future__ import absolute_import, division, print_function
|
|
|
|
|
|
|
|
__metaclass__ = type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
ANSIBLE_METADATA = {'metadata_version': '1.1',
|
|
|
|
'status': ['preview'],
|
|
|
|
'status': ['preview'],
|
|
|
|
'supported_by': 'community'}
|
|
|
|
'supported_by': 'community'}
|
|
|
|
|
|
|
|
|
|
|
|
DOCUMENTATION = '''
|
|
|
|
DOCUMENTATION = r'''
|
|
|
|
module: bigip_snmp_trap
|
|
|
|
module: bigip_snmp_trap
|
|
|
|
short_description: Manipulate SNMP trap information on a BIG-IP.
|
|
|
|
short_description: Manipulate SNMP trap information on a BIG-IP
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Manipulate SNMP trap information on a BIG-IP.
|
|
|
|
- Manipulate SNMP trap information on a BIG-IP.
|
|
|
|
version_added: 2.4
|
|
|
|
version_added: 2.4
|
|
|
@ -67,70 +71,73 @@ author:
|
|
|
|
- Tim Rupp (@caphrim007)
|
|
|
|
- Tim Rupp (@caphrim007)
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = r'''
|
|
|
|
- name: Create snmp v1 trap
|
|
|
|
- name: Create snmp v1 trap
|
|
|
|
bigip_snmp_trap:
|
|
|
|
bigip_snmp_trap:
|
|
|
|
community: "general"
|
|
|
|
community: general
|
|
|
|
destination: "1.2.3.4"
|
|
|
|
destination: 1.2.3.4
|
|
|
|
name: "my-trap1"
|
|
|
|
name: my-trap1
|
|
|
|
network: "management"
|
|
|
|
network: management
|
|
|
|
port: "9000"
|
|
|
|
port: 9000
|
|
|
|
snmp_version: "1"
|
|
|
|
snmp_version: 1
|
|
|
|
server: "lb.mydomain.com"
|
|
|
|
server: lb.mydomain.com
|
|
|
|
user: "admin"
|
|
|
|
user: admin
|
|
|
|
password: "secret"
|
|
|
|
password: secret
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
- name: Create snmp v2 trap
|
|
|
|
- name: Create snmp v2 trap
|
|
|
|
bigip_snmp_trap:
|
|
|
|
bigip_snmp_trap:
|
|
|
|
community: "general"
|
|
|
|
community: general
|
|
|
|
destination: "5.6.7.8"
|
|
|
|
destination: 5.6.7.8
|
|
|
|
name: "my-trap2"
|
|
|
|
name: my-trap2
|
|
|
|
network: "default"
|
|
|
|
network: default
|
|
|
|
port: "7000"
|
|
|
|
port: 7000
|
|
|
|
snmp_version: "2c"
|
|
|
|
snmp_version: 2c
|
|
|
|
server: "lb.mydomain.com"
|
|
|
|
server: lb.mydomain.com
|
|
|
|
user: "admin"
|
|
|
|
user: admin
|
|
|
|
password: "secret"
|
|
|
|
password: secret
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
RETURN = '''
|
|
|
|
RETURN = r'''
|
|
|
|
snmp_version:
|
|
|
|
snmp_version:
|
|
|
|
description: The new C(snmp_version) configured on the remote device.
|
|
|
|
description: The new C(snmp_version) configured on the remote device.
|
|
|
|
returned: changed and success
|
|
|
|
returned: changed and success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "2c"
|
|
|
|
sample: 2c
|
|
|
|
community:
|
|
|
|
community:
|
|
|
|
description: The new C(community) name for the trap destination.
|
|
|
|
description: The new C(community) name for the trap destination.
|
|
|
|
returned: changed and success
|
|
|
|
returned: changed and success
|
|
|
|
type: list
|
|
|
|
type: list
|
|
|
|
sample: "secret"
|
|
|
|
sample: secret
|
|
|
|
destination:
|
|
|
|
destination:
|
|
|
|
description: The new address for the trap destination in either IP or hostname form.
|
|
|
|
description: The new address for the trap destination in either IP or hostname form.
|
|
|
|
returned: changed and success
|
|
|
|
returned: changed and success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "1.2.3.4"
|
|
|
|
sample: 1.2.3.4
|
|
|
|
port:
|
|
|
|
port:
|
|
|
|
description: The new C(port) of the trap destination.
|
|
|
|
description: The new C(port) of the trap destination.
|
|
|
|
returned: changed and success
|
|
|
|
returned: changed and success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "900"
|
|
|
|
sample: 900
|
|
|
|
network:
|
|
|
|
network:
|
|
|
|
description: The new name of the network the SNMP trap is on.
|
|
|
|
description: The new name of the network the SNMP trap is on.
|
|
|
|
returned: changed and success
|
|
|
|
returned: changed and success
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "management"
|
|
|
|
sample: management
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Client
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Parameters
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import HAS_F5SDK
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import F5ModuleError
|
|
|
|
from distutils.version import LooseVersion
|
|
|
|
from distutils.version import LooseVersion
|
|
|
|
from ansible.module_utils.f5_utils import (
|
|
|
|
|
|
|
|
AnsibleF5Client,
|
|
|
|
try:
|
|
|
|
AnsibleF5Parameters,
|
|
|
|
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
|
|
|
HAS_F5SDK,
|
|
|
|
except ImportError:
|
|
|
|
F5ModuleError,
|
|
|
|
HAS_F5SDK = False
|
|
|
|
iControlUnexpectedHTTPError
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
|