f5os_snmp – Manage SNMP Communities, Users, and Targets using openAPI on F5OS based systems¶
New in version 1.9.0.
Parameters¶
| Parameter | Choices/Defaults | Configuration | Comments | |
|---|---|---|---|---|
|
snmp_community
list
/ elements=dictionary
|
Specifies SNMP Community options to be configured on system
This parameter is required when creating a resource.
It is List of community options to be configured
|
|||
|
name
string
/ required
|
Unique name for snmp community
|
|||
|
security_model
list
/ elements=string
|
Short description of the rule's purpose.
|
|||
|
snmp_mib
dictionary
|
Specifies custom SNMP MIB entries for sysContact, sysLocation, sysName
|
|||
|
syscontact
string
|
SNMPv2 sysContact
|
|||
|
syslocation
string
|
SNMPv2 sysLocation
|
|||
|
sysname
string
|
SNMPv2 sysName
|
|||
|
snmp_target
list
/ elements=dictionary
|
Specifies SNMP targets options to be configured on system
It is List of community options to be configured
|
|||
|
community
string
|
SNMP community name to be configure on snmp target
|
|||
|
ipv4_address
string
|
IPv4 address to be configured on SNMP target config
|
|||
|
ipv6_address
string
|
IPv6 address to be configured on SNMP target config
|
|||
|
name
string
/ required
|
Unique name for snmp target
|
|||
|
port
integer
/ required
|
Port number to used for snmp taget config ipv4/ipv6 address
|
|||
|
security_model
string
|
Security model to be configure on snmp target.
Options are [v1, v2c]
v3 is to be omitted and inherently applied by "user" attribute.
|
|||
|
user
string
|
The user to be used for SNMPv3 targets
|
|||
|
snmp_user
list
/ elements=dictionary
|
Specifies SNMP users options to be configured on system
It is List of user options to be configured
Due to API restrictions, passwords can not be retrieved which leads to
Ansible always detecting changes.
|
|||
|
auth_passwd
string
|
Password to be used for authentication
|
|||
|
auth_proto
string
|
Authentication protocol to be used.
Options are [sha, md5]
|
|||
|
name
string
/ required
|
Unique name for the snmp user
|
|||
|
privacy_passwd
string
|
Password to be used for encryption
|
|||
|
privacy_proto
string
|
Privacy protocol to be used.
Options are [aes, des]
Requires authentication to be configured as well.
|
|||
|
state
string
|
|
snmp configuration state of F5OS system
If
present, Specified snmp configuration will be pushed to F5OS system.If
absent, deletes the snmp configuration if it exists. |
||
Notes¶
Note
- A PATCH call updates only the specified targets, communities, or users mentioned in the request leaving all other unmentioned things unchanged.
- A target cannot be mapped to a community if it is already mapped to a user.
- By default, the security model will be set to v3 when a target is mapped to a user.
Examples¶
- name: Create v1/v2c SNMP Community
f5os_snmp:
snmp_community:
- name: test_1_2c_com
security_model: ['v1', 'v2c']
- name: Create SNMP v3 User
f5os_snmp:
snmp_user:
- name: v3user
auth_proto: "sha"
auth_passwd: "authpass"
privacy_proto: "aes"
privacy_passwd: "privpass"
- name: Create SNMP targets
f5os_snmp:
snmp_target:
- name: v1_target
security_model: v1
ipv4_address: 10.144.140.17
port: 5045
community: test_1_2c_com
- name: v2c_target
security_model: v2c
ipv4_address: 10.144.140.17
port: 5045
community: test_1_2c_com
- name: v3_target
user: v3user
ipv4_address: 10.144.140.17
port: 5045
- name: Set SNMP Contact/Location/Name
f5os_snmp:
snmp_mib:
syscontact: admin@example.com
syslocation: "DC/Room/Rack/Slot"
sysname: F5-System1
- name: Update SNMP Config
f5os_snmp:
snmp_community:
- name: test2_com
security_model: ['v1', 'v2c']
- name: test3_com
security_model: ['v1', 'v2c']
snmp_target:
- name: v1_target
security_model: v1
ipv4_address: 10.144.140.17
port: 5045
community: test2_com
snmp_user:
- name: v3user
auth_proto: "sha"
auth_passwd: "authpass2"
privacy_proto: "aes"
privacy_passwd: "privpass2"
- name: Delete SNMP Config
f5os_snmp:
snmp_community:
- name: test2_com
security_model: ['v1', 'v2c']
- name: test3_com
security_model: ['v1', 'v2c']
snmp_target:
- name: v1_target
security_model: v1
ipv4_address: 10.144.140.17
port: 5045
community: test2_com
state: absent
Return Values¶
The following are the fields unique to this module:
| Key | Returned | Description |
|---|---|---|
|
snmp_community
list
|
changed |
Specifies SNMP Community options to be configured on the system.
|
|
snmp_mib
string
|
changed |
Specifies sysName, sysContact and sysLocation
|
|
snmp_target
list
|
changed |
Specifies SNMP targets options to be configured on the system.
|
|
snmp_user
list
|
changed |
Specifies SNMP users options to be configured on the system.
|