Skip to content

Commit 1c83878

Browse files
authored
Azure edges: default gateway on both interfaces (#40)
* Fix Enterprise CA not set for Azure edges * On Azure Edge set default gateway for both interfaces
1 parent fed66c0 commit 1c83878

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

roles/azure_edges/tasks/azure_cedge_vm.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,11 @@
133133

134134
- name: "Set vpn0_default_gateway fact from VPN 0 subnet value"
135135
ansible.builtin.set_fact:
136-
vpn0_default_gateway: "{{ subnet.cidr | ansible.utils.ipaddr('1') | ansible.utils.ipaddr('address') }}"
137-
loop: "{{ az_subnets }}"
138-
loop_control:
139-
loop_var: subnet
140-
when:
141-
- subnet.VPN == 0
142-
- subnet.type != "cluster"
136+
vpn0_default_gateway: "{{ vpn0_subnet | ansible.utils.ipaddr('1') | ansible.utils.ipaddr('address') }}"
137+
vpn512_default_gateway: "{{ vpn512_subnet | ansible.utils.ipaddr('1') | ansible.utils.ipaddr('address') }}"
138+
vars:
139+
vpn0_subnet: "{{ az_subnets | json_query('[?VPN==`0` && type!=`cluster`].cidr | [0]') }}"
140+
vpn512_subnet: "{{ az_subnets | json_query('[?VPN==`512` && type!=`cluster`].cidr | [0]') }}"
143141

144142
- name: "Set path for bootstrap configuration: {{ userdata_cedge_path }}-{{ hostname }}"
145143
ansible.builtin.set_fact:

roles/azure_edges/templates/userdata_cedge.j2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ vinitparam:
1313
- otp : {{ otp }}
1414
- org : {{ organization_name }}
1515
- vbond: {{ vbond }}
16+
{% if controller_certificate_auth is defined and controller_certificate_auth == "enterprise" %}
17+
- rcc : true
18+
ca-certs:
19+
remove-defaults: false
20+
trusted:
21+
- |
22+
{{ enterprise_root_ca | indent(3) }}
23+
{% endif %}
1624

1725

1826
--===============0630588950316195806==
@@ -189,6 +197,8 @@ Content-Disposition: attachment; filename="config-{{ uuid }}.txt"
189197
mtu 1500
190198
negotiation auto
191199
exit
200+
ip route 0.0.0.0 0.0.0.0 {{ vpn512_default_gateway }}
201+
ip route 0.0.0.0 0.0.0.0 {{ vpn0_default_gateway }}
192202
interface Tunnel1
193203
no shutdown
194204
ip unnumbered GigabitEthernet1

0 commit comments

Comments
 (0)