bigip_data_group – Manage data groups on a BIG-IP
bigip_data_group – Manage data groups on a BIG-IP
New in version 2.6.
Synopsis
- Allows for managing data groups on a BIG-IP. Data groups provide a way to store collections of values on a BIG-IP for later use in things such as LTM rules, iRules, and ASM policies.
Requirements
The below requirements are needed on the host that executes this module.
- f5-sdk >= 3.0.16
Parameters
Parameter | Choices/Defaults | Comments | |
---|---|---|---|
delete_data_group_file boolean |
|
When This parameter is only relevant when | |
external_file_name - |
When creating a new data group, this specifies the file name that you want to give an external data group file on the BIG-IP. This parameter is ignored when This parameter can be used to select an existing data group file to use with an existing external data group. If this value is not provided, it will be given the value specified in This value may only contain letters, numbers, underscores, dashes, or a period. | ||
internal boolean |
|
The type of this data group. You should only consider setting this value in cases where you know exactly what you're doing, or, you are working with a pre-existing internal data group. Be aware that if you deliberately force this parameter to There is a limit of either 4 megabytes or 65,000 records (whichever is more restrictive) for uploads when this parameter is This value cannot be changed once the data group is created. | |
name - / required |
Specifies the name of the data group. | ||
partition - |
Default: "Common" |
Device partition to manage resources on. | |
password - / required |
The password for the user account used to connect to the BIG-IP. You may omit this option by setting the environment variable
| ||
provider - added in 2.5 |
Default: null |
A dict object containing connection details. | |
password - / required |
The password for the user account used to connect to the BIG-IP. You may omit this option by setting the environment variable
| ||
server - / required |
The BIG-IP host. You may omit this option by setting the environment variable | ||
server_port - |
Default: 443 |
The BIG-IP server port. You may omit this option by setting the environment variable | |
ssh_keyfile - |
Specifies the SSH keyfile to use to authenticate the connection to the remote device. This argument is only used for cli transports. You may omit this option by setting the environment variable | ||
timeout - |
Default: 10 |
Specifies the timeout in seconds for communicating with the network device for either connecting or sending commands. If the timeout is exceeded before the operation is completed, the module will error. | |
transport - / required |
|
Configures the transport connection to use when connecting to the remote device. | |
user - / required |
The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You may omit this option by setting the environment variable | ||
validate_certs boolean |
|
If You may omit this option by setting the environment variable | |
records - |
Specifies the records that you want to add to a data group. If you have a large number of records, it is recommended that you use The technical limit of either 1. the number of records, or 2. the total size of all records, varies with the size of the total resources on your system; in particular, RAM. When | ||
key - / required |
The key describing the record in the data group. Your key will be used for validation of the | ||
value - |
The value of the key describing the record in the data group. | ||
records_src - |
Path to a file with records in it. The file should be well-formed. This means that it includes records, one per line, that resemble the following format "key separator value". For example, BIG-IP is strict about this format, but this module is a bit more lax. It will allow you to include arbitrary amounts (including none) of empty space on either side of the separator. For an illustration of this, see the Examples section. Record keys are limited in length to no more than 65520 characters. Values of record keys are limited in length to no more than 65520 characters. The total number of records you can have in your BIG-IP is limited by the memory of the BIG-IP. The format of this content is slightly different depending on whether you specify a When | ||
separator - |
Default: ":=" |
When specifying By default, this parameter's value is This value cannot be changed once it is set. This parameter is only relevant when | |
server - / required |
The BIG-IP host. You may omit this option by setting the environment variable | ||
server_port - added in 2.2 |
Default: 443 |
The BIG-IP server port. You may omit this option by setting the environment variable | |
state - |
|
When When | |
type - |
|
The type of records in this data group. This parameter is especially important because it causes BIG-IP to store your data in different ways so-as to optimize access to it. For example, it would be wrong to specify a list of records containing IP addresses, but label them as a This value cannot be changed once the data group is created. | |
user - / required |
The username to connect to the BIG-IP with. This user must have administrative privileges on the device. You may omit this option by setting the environment variable | ||
validate_certs boolean added in 2.0 |
|
If You may omit this option by setting the environment variable |
Notes
Note
- For more information on using Ansible to manage F5 Networks devices see https://www.ansible.com/integrations/networks/f5.
- Requires the f5-sdk Python package on the host. This is as easy as
pip install f5-sdk
. - Requires BIG-IP software version >= 12.
- The F5 modules only manipulate the running configuration of the F5 product. To ensure that BIG-IP specific configuration persists to disk, be sure to include at least one task that uses the bigip_config module to save the running configuration. Refer to the module’s documentation for the correct usage of the module to save your running configuration.
Examples
- name: Create a data group of addresses
bigip_data_group:
name: foo
password: secret
server: lb.mydomain.com
state: present
user: admin
records:
- key: 0.0.0.0/32
value: External_NAT
- key: 10.10.10.10
value: No_NAT
type: address
delegate_to: localhost
- name: Create a data group of strings
bigip_data_group:
name: foo
password: secret
server: lb.mydomain.com
state: present
user: admin
records:
- key: caddy
value: ""
- key: cafeteria
value: ""
- key: cactus
value: ""
type: string
delegate_to: localhost
- name: Create a data group of IP addresses from a file
bigip_data_group:
name: foo
password: secret
server: lb.mydomain.com
state: present
user: admin
records_src: /path/to/dg-file
type: address
delegate_to: localhost
- name: Update an existing internal data group of strings
bigip_data_group:
name: foo
password: secret
server: lb.mydomain.com
state: present
internal: yes
user: admin
records:
- key: caddy
value: ""
- key: cafeteria
value: ""
- key: cactus
value: ""
delegate_to: localhost
- name: Show the data format expected for records_content - address 1
copy:
dest: /path/to/addresses.txt
content: |
network 10.0.0.0 prefixlen 8 := "Network1",
network 172.16.0.0 prefixlen 12 := "Network2",
network 192.168.0.0 prefixlen 16 := "Network3",
network 2402:9400:1000:0:: prefixlen 64 := "Network4",
host 192.168.20.1 := "Host1",
host 172.16.1.1 := "Host2",
host 172.16.1.1/32 := "Host3",
host 2001:0db8:85a3:0000:0000:8a2e:0370:7334 := "Host4",
host 2001:0db8:85a3:0000:0000:8a2e:0370:7334/128 := "Host5"
- name: Show the data format expected for records_content - address 2
copy:
dest: /path/to/addresses.txt
content: |
10.0.0.0/8 := "Network1",
172.16.0.0/12 := "Network2",
192.168.0.0/16 := "Network3",
2402:9400:1000:0::/64 := "Network4",
192.168.20.1 := "Host1",
172.16.1.1 := "Host2",
172.16.1.1/32 := "Host3",
2001:0db8:85a3:0000:0000:8a2e:0370:7334 := "Host4",
2001:0db8:85a3:0000:0000:8a2e:0370:7334/128 := "Host5"
- name: Show the data format expected for records_content - string
copy:
dest: /path/to/strings.txt
content: |
a := alpha,
b := bravo,
c := charlie,
x := x-ray,
y := yankee,
z := zulu,
- name: Show the data format expected for records_content - integer
copy:
dest: /path/to/integers.txt
content: |
1 := bar,
2 := baz,
3,
4,
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by an Ansible Partner. [certified]
Authors
- Tim Rupp (@caphrim007)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/bigip_data_group_module.html