Documentation

bigip_irule - Manage iRules across different modules on a BIG-IP.

New in version 2.2.

Synopsis

  • Manage iRules across different modules on a BIG-IP.

Options

parameter required default choices comments
content
no
When used instead of 'src', sets the contents of an iRule directly to the specified value. This is for simple values, but can be used with lookup plugins for anything complex or with formatting. Either one of src or content must be provided.
module
yes
  • ltm
  • gtm
The BIG-IP module to add the iRule to.
name
yes
The name of the iRule.
partition
no Common
The partition to create the iRule on.
password
yes
The password for the user account used to connect to the BIG-IP. This option can be omitted if the environment variable F5_PASSWORD is set.
server
yes
The BIG-IP host. This option can be omitted if the environment variable F5_SERVER is set.
server_port
(added in 2.2)
no 443
The BIG-IP server port. This option can be omitted if the environment variable F5_SERVER_PORT is set.
src
yes
The iRule file to interpret and upload to the BIG-IP. Either one of src or content must be provided.
state
no present
  • present
  • absent
Whether the iRule should exist or not.
user
yes
The username to connect to the BIG-IP with. This user must have administrative privileges on the device. This option can be omitted if the environment variable F5_USER is set.
validate_certs
(added in 2.0)
no True
  • True
  • False
If no, SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates. This option can be omitted if the environment variable F5_VALIDATE_CERTS is set.

Examples

- name: Add the iRule contained in templated irule.tcl to the LTM module
  bigip_irule:
      content: "{{ lookup('template', 'irule-template.tcl') }}"
      module: "ltm"
      name: "MyiRule"
      password: "secret"
      server: "lb.mydomain.com"
      state: "present"
      user: "admin"
  delegate_to: localhost

- name: Add the iRule contained in static file irule.tcl to the LTM module
  bigip_irule:
      module: "ltm"
      name: "MyiRule"
      password: "secret"
      server: "lb.mydomain.com"
      src: "irule-static.tcl"
      state: "present"
      user: "admin"
  delegate_to: localhost

Return Values

Common return values are documented here Return Values, the following are the fields unique to this module:

name description returned type sample
content The content of the iRule that was managed changed and success string when LB_FAILED { set wipHost [LB::server addr] }
src The filename that included the iRule source changed and success, when provided string /opt/src/irules/example1.tcl
partition The partition in which the iRule was managed changed and success string Common
name The name of the iRule that was managed changed and success string my-irule
module The module that the iRule was added to changed and success string gtm


Notes

Note

  • Requires the f5-sdk Python package on the host. This is as easy as pip install f5-sdk.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

Support

This module is community maintained without core committer oversight.

For more information on what this means please read Module Support

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.