Coder Social home page Coder Social logo

Comments (4)

Fred-sun avatar Fred-sun commented on July 24, 2024 2

@rnsc Glad you raised this question, we will investigate and check this feature. Thank you!

from azure.

hdiass avatar hdiass commented on July 24, 2024

hello,
i'm afraid we need this feature to feed a list into the probes with "with_items" option. If not, how can we use a list to create multiple load_balancing_rules ?

Thanks

from azure.

Fred-sun avatar Fred-sun commented on July 24, 2024

hello,
i'm afraid we need this feature to feed a list into the probes with "with_items" option. If not, how can we use a list to create multiple load_balancing_rules ?

Thanks

We are investigating this feature and will make improvements as soon as possible!

from azure.

tfmark avatar tfmark commented on July 24, 2024

Is anyone looking into this issue? The other Azure Ansible modules I've used are additive and only upsert data if the key (e.g. name) is the same (for example the NSG rules)...

That said, the following playbook works around the issue by creating the list of loadbalancer rules first (via set_fact + loop) and then feeds this into azure_rm_loadbalancer. @hdiass I guess you found your own workaround, but for others:

---
- name: Load Balancer Example 
  hosts: localhost
  vars:
    clients:
    - name: client1
      number: 10
    - name: client2
      number: 20
    - name: client3
      number: 30

  tasks:
    # workaround dumb module behaviour
  - set_fact:
      load_balancing_rules: "{{ load_balancing_rules | default([]) + [load_balancing_rule] }}"
    loop: "{{ clients }}"
    loop_control:
      label: "{{ item.name }} ({{ item.number }})"
    vars:
      load_balancing_rule:
        name: "{{ item.name }}"
        backend_port: "{{ 20000 + (item.number * 10) | int}}"
        protocol: Tcp
        frontend_port: "{{ 10000 + (item.number * 10) | int}}"
        frontend_ip_configuration: "my-frontend-ip"
        backend_address_pool : "my-backend-address-pool"
        probe: my-health-probe
        # disable_outbound_snat: true  

  - debug: var=load_balancing_rules

  - name: Add Load Balancer rules
    azure.azcollection.azure_rm_loadbalancer:
      profile: prod
      resource_group: load-balancer-rg
      name: dummy-load-balancer
      load_balancing_rules: "{{ load_balancing_rules }}"

from azure.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.