|
|
|
@ -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
|
|
|
|
module: bigip_snmp
|
|
|
|
short_description: Manipulate general SNMP settings on a BIG-IP.
|
|
|
|
short_description: Manipulate general SNMP settings on a BIG-IP
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Manipulate general SNMP settings on a BIG-IP.
|
|
|
|
- Manipulate general SNMP settings on a BIG-IP.
|
|
|
|
version_added: 2.4
|
|
|
|
version_added: 2.4
|
|
|
|
@ -56,42 +60,42 @@ author:
|
|
|
|
- Tim Rupp (@caphrim007)
|
|
|
|
- Tim Rupp (@caphrim007)
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = r'''
|
|
|
|
- name: Set snmp contact
|
|
|
|
- name: Set snmp contact
|
|
|
|
bigip_snmp:
|
|
|
|
bigip_snmp:
|
|
|
|
contact: "Joe User"
|
|
|
|
contact: Joe User
|
|
|
|
password: "secret"
|
|
|
|
password: secret
|
|
|
|
server: "lb.mydomain.com"
|
|
|
|
server: lb.mydomain.com
|
|
|
|
user: "admin"
|
|
|
|
user: admin
|
|
|
|
validate_certs: "false"
|
|
|
|
validate_certs: false
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
|
|
|
|
|
|
|
|
- name: Set snmp location
|
|
|
|
- name: Set snmp location
|
|
|
|
bigip_snmp:
|
|
|
|
bigip_snmp:
|
|
|
|
location: "US West 1"
|
|
|
|
location: US West 1
|
|
|
|
password: "secret"
|
|
|
|
password: secret
|
|
|
|
server: "lb.mydomain.com"
|
|
|
|
server: lb.mydomain.com
|
|
|
|
user: "admin"
|
|
|
|
user: admin
|
|
|
|
validate_certs: "false"
|
|
|
|
validate_certs: no
|
|
|
|
delegate_to: localhost
|
|
|
|
delegate_to: localhost
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
RETURN = '''
|
|
|
|
RETURN = r'''
|
|
|
|
agent_status_traps:
|
|
|
|
agent_status_traps:
|
|
|
|
description: Value that the agent status traps was set to.
|
|
|
|
description: Value that the agent status traps was set to.
|
|
|
|
returned: changed
|
|
|
|
returned: changed
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "enabled"
|
|
|
|
sample: enabled
|
|
|
|
agent_authentication_traps:
|
|
|
|
agent_authentication_traps:
|
|
|
|
description: Value that the authentication status traps was set to.
|
|
|
|
description: Value that the authentication status traps was set to.
|
|
|
|
returned: changed
|
|
|
|
returned: changed
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "enabled"
|
|
|
|
sample: enabled
|
|
|
|
device_warning_traps:
|
|
|
|
device_warning_traps:
|
|
|
|
description: Value that the warning status traps was set to.
|
|
|
|
description: Value that the warning status traps was set to.
|
|
|
|
returned: changed
|
|
|
|
returned: changed
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "enabled"
|
|
|
|
sample: enabled
|
|
|
|
contact:
|
|
|
|
contact:
|
|
|
|
description: The new value for the person who administers SNMP on the device.
|
|
|
|
description: The new value for the person who administers SNMP on the device.
|
|
|
|
returned: changed
|
|
|
|
returned: changed
|
|
|
|
@ -101,16 +105,18 @@ location:
|
|
|
|
description: The new value for the system's physical location.
|
|
|
|
description: The new value for the system's physical location.
|
|
|
|
returned: changed
|
|
|
|
returned: changed
|
|
|
|
type: string
|
|
|
|
type: string
|
|
|
|
sample: "US West 1a"
|
|
|
|
sample: US West 1a
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.f5_utils import (
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Client
|
|
|
|
AnsibleF5Client,
|
|
|
|
from ansible.module_utils.f5_utils import AnsibleF5Parameters
|
|
|
|
AnsibleF5Parameters,
|
|
|
|
from ansible.module_utils.f5_utils import HAS_F5SDK
|
|
|
|
HAS_F5SDK,
|
|
|
|
from ansible.module_utils.f5_utils import F5ModuleError
|
|
|
|
F5ModuleError,
|
|
|
|
|
|
|
|
iControlUnexpectedHTTPError
|
|
|
|
try:
|
|
|
|
)
|
|
|
|
from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
|
|
|
|
|
|
|
|
except ImportError:
|
|
|
|
|
|
|
|
HAS_F5SDK = False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
|
class Parameters(AnsibleF5Parameters):
|
|
|
|
@ -218,29 +224,17 @@ class ArgumentSpec(object):
|
|
|
|
self.supports_check_mode = True
|
|
|
|
self.supports_check_mode = True
|
|
|
|
self.choices = ['enabled', 'disabled']
|
|
|
|
self.choices = ['enabled', 'disabled']
|
|
|
|
self.argument_spec = dict(
|
|
|
|
self.argument_spec = dict(
|
|
|
|
contact=dict(
|
|
|
|
contact=dict(),
|
|
|
|
required=False,
|
|
|
|
|
|
|
|
default=None
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
agent_status_traps=dict(
|
|
|
|
agent_status_traps=dict(
|
|
|
|
required=False,
|
|
|
|
|
|
|
|
default=None,
|
|
|
|
|
|
|
|
choices=self.choices
|
|
|
|
choices=self.choices
|
|
|
|
),
|
|
|
|
),
|
|
|
|
agent_authentication_traps=dict(
|
|
|
|
agent_authentication_traps=dict(
|
|
|
|
required=False,
|
|
|
|
|
|
|
|
default=None,
|
|
|
|
|
|
|
|
choices=self.choices
|
|
|
|
choices=self.choices
|
|
|
|
),
|
|
|
|
),
|
|
|
|
device_warning_traps=dict(
|
|
|
|
device_warning_traps=dict(
|
|
|
|
required=False,
|
|
|
|
|
|
|
|
default=None,
|
|
|
|
|
|
|
|
choices=self.choices
|
|
|
|
choices=self.choices
|
|
|
|
),
|
|
|
|
),
|
|
|
|
location=dict(
|
|
|
|
location=dict()
|
|
|
|
required=False,
|
|
|
|
|
|
|
|
default=None
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
self.f5_product_name = 'bigip'
|
|
|
|
self.f5_product_name = 'bigip'
|
|
|
|
|
|
|
|
|
|
|
|
|