---

- name: Flap service
  netscaler_service:

    nitro_user: "{{nitro_user}}"
    nitro_pass: "{{nitro_pass}}"
    nsip: "{{nsip}}"

    state: present

    name: service-http
    ip: 192.168.1.1
    ipaddress: 192.168.1.1
    port: 80
    servicetype: HTTP

    disabled: "{{ item|int % 2 }}"
  with_sequence: count=20
  delay: 1

  delegate_to: localhost
  register: result
  check_mode: "{{ check_mode }}"

- name: Flap service
  netscaler_service:

    nitro_user: "{{nitro_user}}"
    nitro_pass: "{{nitro_pass}}"
    nsip: "{{nsip}}"

    state: present

    name: service-http
    ip: 192.168.1.1
    ipaddress: 192.168.1.1
    port: 80
    servicetype: HTTP

    disabled: "{{ item|int % 2 }}"
  with_sequence: count=20
  delay: 5

  delegate_to: localhost
  register: result
  check_mode: "{{ check_mode }}"
