Netscaler Ansible question

Hello,

In my Netscaler Ansible module, I encountered a problem with netscaler_lb_vserver. I’m trying to use a list of servicebindings to create a single lb vserver with two services, but instead it only creates “test2-service” for that lb vserver, “test1-service” isn’t there. Is there a way to use loop variable in netscaler servicebindings?

  • hosts: netscaler
    gather_facts: no

vars:
servicebindings:

  • servicename: “test1-service”
    weight: “50”
  • servicename: “test2-service”
    weight: “50”

tasks:

  • name: Create netscaler endpoint lbvservers
    delegate_to: localhost

netscaler_lb_vserver:
nsip: “{{ nsip }}”
nitro_user: “{{ nitro_user }}”
nitro_pass: “{{ nitro_pass }}”

state: present

name: “test-lbvserver”
servicetype: “HTTP”
ipv46: “10.10.10.10”
port: “80”
lbmethod: “ROUNDROBIN”
servicebindings:

  • servicename: “{{ item.servicename }}”
    weight: “{{ item.weight }}”
    with_items: “{{ servicebindings }}”

Thank you,

  • Xinhuan Zheng