I’m having trouble getting my variables correct to add multiple rules to a single policy. I need a loop because I will be adding multiple VIP with different policy names and multiple rules per policy. The module I’m using is bigip_policy_rule.
- name: Add multiple rules to the new policy
bigip_policy_rule:
policy: Policy-Foo <------ I want to use a variable for the policy name as well
name: "{{ item.name }}"
conditions: "{{ item.conditions }}"
actions: "{{ item.actions }}"
provider:
server: lb.mydomain.com
user: admin
password: secret
delegate_to: localhost
loop: "{{ rules }}"
Variables file looks like this:
rules: