W3cubDocs

/Ansible

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.

Requirements (on host that executes module)

  • f5-sdk

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.
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 template irule.tcl to the LTM module
  bigip_irule:
      content: "{{ lookup('template', 'irule.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.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
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.

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

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/bigip_irule_module.html