首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Ansible更新Azure应用程序网关实例

如何使用Ansible更新Azure应用程序网关实例
EN

Stack Overflow用户
提问于 2020-10-22 13:07:51
回答 1查看 182关注 0票数 0

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

但是,它只提供了创建应用网关实例的示例。谁能举例说明如何使用ansible更新现有的应用程序网关。

EN

回答 1

Stack Overflow用户

发布于 2020-10-31 22:37:40

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

代码语言:javascript
复制
- 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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64475652

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档