bigip_policy_rule - error with doc example for set_variable action
Trying to improve the automation of F5 config, I try to switch to ansible for policy configuration. Before trying to implement my need based on the doc (using replace action), I first try to make the example of the galaxy documentation working. All the example are working except :
- name: rule3
actions:
- type: set_variable
variable_name: user-agent
expression: tcl:[HTTP::header User-Agent]
event: request
conditions:
- type: http_uri
path_begins_with_any:
- /HomePage/
Which return this error
"msg": "Unsupported parameters for (bigip_policy_rule) module: event, expression, variable_name found in actions. Supported parameters include: asm_policy, location, pool, type, virtual"}
Created INFRAANO-431 for internal tracking
Hi, Is it possible to have a status of the internal ticket ? The documentation is still the same, and the error still occurs.
Hi @xavgra2, I tried the following playbook with success:
tasks:
- name: Create policies
bigip_policy:
name: Policy-Foo
state: present
provider:
server: "{{private_ip}}"
user: "admin"
password: "mypwd"
server_port: 443
validate_certs: false
delegate_to: localhost
- name: Add a rule to the new policy
bigip_policy_rule:
policy: Policy-Foo
name: rule3
conditions:
- type: http_uri
path_begins_with_any:
- /ABC
actions:
- type: forward
pool: pool-svrs
provider:
server: "{{private_ip}}"
user: "admin"
password: "mypwd"
server_port: 443
validate_certs: false
delegate_to: localhost
- name: Add multiple rules to the new policy
bigip_policy_rule:
policy: Policy-Foo
name: "{{ item.name }}"
conditions: "{{ item.conditions }}"
actions: "{{ item.actions }}"
provider:
server: "{{private_ip}}"
user: "admin"
password: "mypwd"
server_port: 443
validate_certs: false
delegate_to: localhost
loop:
- name: rule1
actions:
- type: forward
pool: pool-svrs
conditions:
- type: http_uri
path_begins_with_any:
- /euro
- name: rule2
actions:
- type: forward
pool: pool-svrs
conditions:
- type: http_uri
path_begins_with_any:
- /HomePage/
- name: rule3
actions:
- type: set_variable
variable_name: user-agent
expression: tcl:[HTTP::header User-Agent]
event: request
conditions:
- type: http_uri
path_begins_with_any:
- /HomePage/
Are you still facing the issue?
Hi, The issue has been solved since a few release, but I forgot to close my ticket. I apologize for that.
I confirm that's OK now.