diff --git a/deploy_partition.yaml b/deploy_partition.yaml index 7a59227e..369658c9 100644 --- a/deploy_partition.yaml +++ b/deploy_partition.yaml @@ -88,3 +88,18 @@ - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key) | length == 2 - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[0]["last_sync"] != None - lookup('metal', 'search', 'switch', api_url=metal_partition_metal_api_protocol+'://'+metal_partition_metal_api_addr+':'+metal_partition_metal_api_port|string+metal_partition_metal_api_basepath, api_hmac=metal_partition_metal_api_hmac_edit_key)[1]["last_sync"] != None + +- name: Ensure return path to PXE network is present + hosts: leaves:&cumulus + gather_facts: no + tasks: + - name: check for static route in mgmt vrf + command: ip r s vrf mgmt + register: route_check + changed_when: false + + - name: ensure that static route for return path to pxe network is present + command: "ip r a 10.0.1.0/24 vrf mgmt via {{ dhcp_server_ip }} dev vlan4000" + when: + - '"10.0.1.0/24" not in route_check.stdout' + - dhcp_server_ip is defined diff --git a/roles/cumulus/tasks/main.yaml b/roles/cumulus/tasks/main.yaml index b7042195..1a7cac99 100644 --- a/roles/cumulus/tasks/main.yaml +++ b/roles/cumulus/tasks/main.yaml @@ -11,17 +11,6 @@ out_interface: eth0 jump: MASQUERADE -- name: check for static route in mgmt vrf - command: ip r s vrf mgmt - register: route_check - changed_when: false - -- name: ensure that static route for return path to pxe network is present - command: "ip r a 10.0.1.0/24 vrf mgmt via {{ dhcp_server_ip }} dev vlan4000" - when: - - '"10.0.1.0/24" not in route_check.stdout' - - dhcp_server_ip is defined - - name: create bridgemac.json copy: src: bridgemac.json