【问题标题】:How to update instance of Azure Application Gateway using Ansible如何使用 Ansible 更新 Azure 应用程序网关的实例
【发布时间】:2021-02-05 01:57:13
【问题描述】:

我正在尝试使用 Ansible 自动管理应用程序网关的某些方面。一些示例是向后端池添加新主机、增加实例数等。我在这里找到了 azure_rm_appgateway_module 的示例:https://docs.ansible.com/ansible/latest/collections/azure/azcollection/azure_rm_appgateway_module.html

但是,它只有创建应用程序网关实例的示例。有人可以指出一些如何使用 ansible 更新现有应用程序网关的示例。

【问题讨论】:

    标签: azure ansible azure-application-gateway


    【解决方案1】:

    以下是使用 Ansible playbook 管理 Azure 应用程序网关的快速参考示例,

    - name: Create instance of Application Gateway
      azure_rm_appgateway:
        resource_group: "{{ resource_group }}"
        name: "{{ appgw_name }}"
        sku:
          name: standard_small
          tier: standard
          capacity: 2
        gateway_ip_configurations:
          - subnet:
              id: "{{ subnet.response[0].id }}"
            name: appGatewayIP
        frontend_ip_configurations:
          - public_ip_address: "{{ publicip_name }}"
            name: appGatewayFrontendIP
        frontend_ports:
          - port: 80
            name: appGatewayFrontendPort
        backend_address_pools:
          - backend_addresses:
              - ip_address: "{{ aci_1_output.response[0].properties.ipAddress.ip }}"
              - ip_address: "{{ aci_2_output.response[0].properties.ipAddress.ip }}"
            name: appGatewayBackendPool
        backend_http_settings_collection:
          - port: 80
            protocol: http
            cookie_based_affinity: enabled
            name: appGatewayBackendHttpSettings
        http_listeners:
          - frontend_ip_configuration: appGatewayFrontendIP
            frontend_port: appGatewayFrontendPort
            name: appGatewayHttpListener
        request_routing_rules:
          - rule_type: Basic
            backend_address_pool: appGatewayBackendPool
            backend_http_settings: appGatewayBackendHttpSettings
            http_listener: appGatewayHttpListener
            name: rule1
    

    参考:Doc

    【讨论】:

      猜你喜欢
      • 2021-12-04
      • 2022-10-25
      • 2019-09-12
      • 2012-04-18
      • 2019-10-28
      • 1970-01-01
      • 2021-08-09
      • 1970-01-01
      • 2022-11-10
      相关资源
      最近更新 更多