Ansible repository with playbooks to manage azure objects
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 

133 Zeilen
4.5 KiB

  1. {
  2. "location": "{{ agw.location }}",
  3. "properties": {
  4. "sku": {
  5. "capacity": "{{ agw.sku.capacity | default(2) }}",
  6. "name": "{{ agw.sku.name | default('Standard_v2') }}",
  7. "tier": "{{ agw.sku.tier | default('Standard_v2') }}"
  8. },
  9. "gatewayIPConfigurations": [
  10. {% for gwipc in agw.gateway_ip_configurations %}
  11. {
  12. "name": "{{ gwipc.name }}",
  13. "properties": {
  14. "subnet": {
  15. "id": "{{ gwipc.subnet }}"
  16. }
  17. }
  18. },
  19. {% endfor %}
  20. ],
  21. "sslCertificates": [],
  22. "frontendIPConfigurations": [
  23. {% for fipc in agw.frontend_ip_configurations %}
  24. {
  25. "name": "{{ fipc.name }}",
  26. "properties": {
  27. "privateIPAllocationMethod": "{{ fipc.private_ip_allocation_method | default('Dynamic') }}",
  28. "publicIPAddress": {
  29. "id": "{{ fipc.public_ip_address }}"
  30. },
  31. {% if fipc.subnet is defined %}
  32. "subnet": {
  33. "id": "{{ fipc.subnet }}"
  34. }
  35. {% endif %}
  36. }
  37. },
  38. {% endfor %}
  39. ],
  40. "frontendPorts": [
  41. {% for fport in agw.frontend_ports %}
  42. {
  43. "name": "{{ fport.name }}",
  44. "properties": {
  45. "port": {{ fport.port }},
  46. }
  47. },
  48. {% endfor %}
  49. ],
  50. "backendAddressPools": [
  51. {% for bp in agw.backend_address_pools %}
  52. {
  53. "name": "{{ bp.name }}",
  54. "properties": {
  55. "backendAddresses": [
  56. {% for ip in bp.backend_addresses %}
  57. {
  58. "ipAddress": "{{ ip }}"
  59. },
  60. {% endfor %}
  61. ],
  62. },
  63. },
  64. {% endfor %}
  65. ],
  66. "backendHttpSettingsCollection": [
  67. {% for bset in agw.backend_http_settings_collection %}
  68. {
  69. "name": "{{ bset.name }}",
  70. "properties": {
  71. "port": {{ bset.port }},
  72. "protocol": "{{ bset.protocol | default('Http') }}",
  73. "cookieBasedAffinity": "{{ bset.cookie_based_affinity | default('Enabled') }}",
  74. "pickHostNameFromBackendAddress": {{ bset.pick_host_name_from_backend_address | default(false) }},
  75. "probeEnabled": {{ bset.probe_enabled | default(false) }},
  76. {% if bset.probe_enabled is defined and bset.probe_enabled %}
  77. "probe": {
  78. "id": "{{ bset.probe }}"
  79. },
  80. {% endif %}
  81. "affinityCookieName": "{{ bset.affinity_cookie_name | default('ApplicationGatewayAffinity') }}",
  82. "requestTimeout": {{ bset.request_timeout | default(20) }},
  83. },
  84. },
  85. {% endfor %}
  86. ],
  87. "httpListeners": [
  88. {% for listener in agw.http_listeners %}
  89. {
  90. "name": "{{ listener.name }}",
  91. "properties": {
  92. "frontendIPConfiguration": {
  93. "id": "/subscriptions/{{ subscription_id }}/resourceGroups/{{ agw.resource_group }}/providers/Microsoft.Network/applicationGateways/{{ agw.name }}/frontendIPConfigurations/{{ listener.frontend_ip_configuration }}"
  94. },
  95. "frontendPort": {
  96. "id": "/subscriptions/{{ subscription_id }}/resourceGroups/{{ agw.resource_group }}/providers/Microsoft.Network/applicationGateways/{{ agw.name }}/frontendPorts/{{ listener.frontend_port }}"
  97. },
  98. "protocol": "{{ listener.protocol | default('Http') }}",
  99. "requireServerNameIndication": {{ listener.require_sni | default(false) }},
  100. {% if listener.protocol is defined and listener.protocol == 'Https' %}
  101. "sslCertificate": {{ listener.sslCertificate }},
  102. "sslProfile": {{ listener.sslProfile }},
  103. {% endif %}
  104. },
  105. },
  106. {% endfor %}
  107. ],
  108. "urlPathMaps": [],
  109. "requestRoutingRules": [
  110. {% for rrr in agw.request_routing_rules %}
  111. {
  112. "name": "{{ rrr.name }}",
  113. "properties": {
  114. "ruleType": "{{ rrr.rule_type | default('Basic') }}",
  115. "httpListener": {
  116. "id": "/subscriptions/{{ subscription_id }}/resourceGroups/{{ agw.resource_group }}/providers/Microsoft.Network/applicationGateways/{{ agw.name }}/httpListeners/{{ rrr.http_listener }}"
  117. },
  118. "backendAddressPool": {
  119. "id": "/subscriptions/{{ subscription_id }}/resourceGroups/{{ agw.resource_group }}/providers/Microsoft.Network/applicationGateways/{{ agw.name }}/backendAddressPools/{{ rrr.backend_address_pool }}"
  120. },
  121. "backendHttpSettings": {
  122. "id": "/subscriptions/{{ subscription_id }}/resourceGroups/{{ agw.resource_group }}/providers/Microsoft.Network/applicationGateways/{{ agw.name }}/backendHttpSettingsCollection/{{ rrr.backend_http_settings }}"
  123. }
  124. },
  125. },
  126. {% endfor %}
  127. ],
  128. "probes": [],
  129. "redirectConfigurations": [],
  130. "enableHttp2": false
  131. }
  132. }