# Netscaler Ansible question

**URL:** <https://forum.ansible.com/t/netscaler-ansible-question/32336>\
**Category:** Ansible Project\
**Created:** [February 26, 2020, 8:11pm UTC](https://forum.ansible.com/t/netscaler-ansible-question/32336 "2020-02-26T20:11:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xinhuan\_Zheng](https://avatars.discourse-cdn.com/v4/letter/x/a88e57/32.png) [@Xinhuan\_Zheng](https://forum.ansible.com/u/Xinhuan_Zheng)\
**Post date:** [February 26, 2020, 8:11pm UTC](https://forum.ansible.com/t/netscaler-ansible-question/32336/1 "2020-02-26T20:11:18Z")

</div>

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
