I'm trying to create a policy rule using a loop to add multiple rules. I'm
getting an error and I have tried several scenarios but can't figure out.
here's what I have.
Here are the vars:
rules:
A3-JL1L-test.local:
- rl_name: test.local
actions:
- type: forward
pool: "A3-JL1L-test.local_443_pool"
conditions:
- type: http_uri
path_begins_with: /test_path
Here's the module from the playbook:
- name: Add multiple rules to the new policy
bigip_policy_rule:
provider: "{{ cli }}"
policy: "{{ item }}_{{ vips[item].port }}_policy"
name: "{{ rules[item].rl_name }}"
actions: "{{ rules[item].actions }}"
conditions: "{{ rules[item].conditions }}"
state: "{{ defaults.state }}"
loop: "{{ rules.keys() }}"
Here's the error:
fatal: [JTCLANDEVLB525003.entmconn.site]: FAILED! => {
"msg": "The task includes an option with an undefined variable. The
error was: 'list object' has no attribute 'rl_name'\n\nThe error appears to
be in
'/automation/ansible/playbooks/f5/Test/app_deployment/tasks/ssl_bridging_l7.yml':
line 172, column 7, but may\nbe elsewhere in the file depending on the
exact syntax problem.\n\nThe offending line appears to be:\n\n\n - name:
Add multiple rules to the new policy\n ^ here\n"
}
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/34c135ce-6b01-41ac-ac31-b063045bc3ae%40googlegroups.com.