From c0366238cf0fe15ed3e55d1d3728dc0395956452 Mon Sep 17 00:00:00 2001 From: przsus <101723670+przsus@users.noreply.github.com> Date: Tue, 22 Oct 2024 09:33:40 +0200 Subject: [PATCH 1/4] cluster deployment --- .gitignore | 1 + galaxy.yml | 2 +- playbooks/aws/aws_sdwan_config.yml | 6 ++++++ playbooks/aws/full_deploy_and_configure.yml | 14 ++++++++++++++ playbooks/azure/full_deploy_and_configure.yml | 14 ++++++++++++++ requirements.yml | 4 ++-- 6 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 527f862..47a2679 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ playbooks/catalystwan.log playbooks/sdwan_config_dev.yml playbooks/templates_examples/output_backup_device_configuration playbooks/templates_examples/output_backup_running_config +.idea diff --git a/galaxy.yml b/galaxy.yml index 616d1f5..16315d6 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: cisco name: sdwan -version: 0.2.1 +version: 0.2.2 readme: README.md authors: - Arkadiusz Cichon diff --git a/playbooks/aws/aws_sdwan_config.yml b/playbooks/aws/aws_sdwan_config.yml index d273ded..f813792 100644 --- a/playbooks/aws/aws_sdwan_config.yml +++ b/playbooks/aws/aws_sdwan_config.yml @@ -43,6 +43,12 @@ vmanage_instances: - hostname: "{{ aws_resources_prefix }}-vManage" system_ip: 192.168.1.1 site_id: 111 +# - hostname: "{{ aws_resources_prefix }}-vManage2" +# system_ip: 192.168.4.1 +# site_id: 112 +# - hostname: "{{ aws_resources_prefix }}-vManage3" +# system_ip: 192.168.5.1 +# site_id: 113 # vBond diff --git a/playbooks/aws/full_deploy_and_configure.yml b/playbooks/aws/full_deploy_and_configure.yml index 81ab3be..776bcbe 100644 --- a/playbooks/aws/full_deploy_and_configure.yml +++ b/playbooks/aws/full_deploy_and_configure.yml @@ -27,6 +27,20 @@ - cisco.catalystwan.onboarding_controllers +- name: Cluster configuration + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + tasks: + - name: Configure cluster setup if required + ansible.builtin.include_role: + name: cisco.catalystwan.cluster + when: (vmanage_instances | first).cluster_private_ip is defined + + - name: Generate bootstrap configuration for synced edges hosts: localhost gather_facts: false diff --git a/playbooks/azure/full_deploy_and_configure.yml b/playbooks/azure/full_deploy_and_configure.yml index 23dcda1..7542875 100644 --- a/playbooks/azure/full_deploy_and_configure.yml +++ b/playbooks/azure/full_deploy_and_configure.yml @@ -27,6 +27,20 @@ - cisco.catalystwan.onboarding_controllers +- name: Cluster configuration + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + tasks: + - name: Configure cluster setup if required + ansible.builtin.include_role: + name: cisco.catalystwan.cluster + when: (vmanage_instances | first).cluster_private_ip is defined + + - name: Generate bootstrap configuration for synced edges hosts: localhost gather_facts: false diff --git a/requirements.yml b/requirements.yml index 14f5889..1555851 100644 --- a/requirements.yml +++ b/requirements.yml @@ -4,6 +4,6 @@ collections: - name: azure.azcollection version: 1.19.0 - name: cisco.catalystwan - version: 0.2.1 + version: 0.2.3 - name: cisco.sdwan_deployment - version: 0.2.0 + version: 0.2.3 From 5a08373bfd0daa942ceddff917039e3e83bf9283 Mon Sep 17 00:00:00 2001 From: przsus <101723670+przsus@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:41:20 +0200 Subject: [PATCH 2/4] new playbooks for cluster deployment --- .ansible-lint | 1 + .../aws/cluster_deploy_and_configure.yml | 101 ++++++++++++++++++ playbooks/aws/full_deploy_and_configure.yml | 14 --- .../azure/cluster_deploy_and_configure.yml | 101 ++++++++++++++++++ playbooks/azure/full_deploy_and_configure.yml | 14 --- 5 files changed, 203 insertions(+), 28 deletions(-) create mode 100644 playbooks/aws/cluster_deploy_and_configure.yml create mode 100644 playbooks/azure/cluster_deploy_and_configure.yml diff --git a/.ansible-lint b/.ansible-lint index 6f36609..26566d4 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -45,6 +45,7 @@ mock_roles: - cisco.catalystwan.software_upgrades_remote - cisco.catalystwan.api_ready - cisco.catalystwan.administration_settings + - cisco.catalystwan.cluster - cisco.catalystwan.onboarding_controllers - cisco.catalystwan.sync_pnp_edges - cisco.catalystwan.activate_edges diff --git a/playbooks/aws/cluster_deploy_and_configure.yml b/playbooks/aws/cluster_deploy_and_configure.yml new file mode 100644 index 0000000..ba57d0a --- /dev/null +++ b/playbooks/aws/cluster_deploy_and_configure.yml @@ -0,0 +1,101 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + + +# Deploy Cisco SD-WAN on AWS +- name: Deploy Cisco SD-WAN versions 20.13 on AWS + hosts: localhost + gather_facts: false + vars_files: + ./aws_sdwan_config.yml + tasks: + roles: + - cisco.sdwan_deployment.aws_network_infrastructure + - cisco.sdwan_deployment.aws_controllers + + +- name: Verify server connectivity, set initial configuration, onboard controllers + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.api_ready + - cisco.catalystwan.administration_settings + - cisco.catalystwan.onboarding_controllers + + +- name: Cluster configuration + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.cluster + + +- name: Generate bootstrap configuration for synced edges + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.sync_pnp_edges + + +# Deploying edges requires vbond_mgmt_public_ip, otp and uuid! +- name: Deploy Edge devices based on generated boostrap configuration + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ deployment_edges_config }}" + roles: + - cisco.sdwan_deployment.aws_edges + + +# Onboard edge devices and wait for their reachability +- name: Activate and validate edge devices + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + roles: + - cisco.catalystwan.activate_edges + + +# Attach templates with running-config for all devices +- name: Set vmanage mode for all devices + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + vars: + edge_instances: "{{ deployed_edge_instances }}" + roles: + - cisco.catalystwan.vmanage_mode + +# After assigning templates, we should add check there to verify that device is managed by templates +# add to vmanage_mode role. + +# Health checks +- name: Verify control connections and BFD, OMP + hosts: localhost + gather_facts: false + vars_files: + - ./aws_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + roles: + - cisco.catalystwan.health_checks diff --git a/playbooks/aws/full_deploy_and_configure.yml b/playbooks/aws/full_deploy_and_configure.yml index 776bcbe..81ab3be 100644 --- a/playbooks/aws/full_deploy_and_configure.yml +++ b/playbooks/aws/full_deploy_and_configure.yml @@ -27,20 +27,6 @@ - cisco.catalystwan.onboarding_controllers -- name: Cluster configuration - hosts: localhost - gather_facts: false - vars_files: - - ./aws_sdwan_config.yml - - ./pnp_credentials.yml - - "{{ results_path_controllers }}" - tasks: - - name: Configure cluster setup if required - ansible.builtin.include_role: - name: cisco.catalystwan.cluster - when: (vmanage_instances | first).cluster_private_ip is defined - - - name: Generate bootstrap configuration for synced edges hosts: localhost gather_facts: false diff --git a/playbooks/azure/cluster_deploy_and_configure.yml b/playbooks/azure/cluster_deploy_and_configure.yml new file mode 100644 index 0000000..d4031da --- /dev/null +++ b/playbooks/azure/cluster_deploy_and_configure.yml @@ -0,0 +1,101 @@ +# Copyright 2024 Cisco Systems, Inc. and its affiliates +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) + + +# Deploy Cisco SD-WAN version 20.13 on Azure +- name: Deploy Cisco SD-WAN versions 20.13 on Azure + hosts: localhost + gather_facts: false + vars_files: + ./azure_sdwan_config.yml + tasks: + roles: + - cisco.sdwan_deployment.azure_network_infrastructure + - cisco.sdwan_deployment.azure_controllers + + +- name: Verify server connectivity, set initial configuration, onboard controllers + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.api_ready + - cisco.catalystwan.administration_settings + - cisco.catalystwan.onboarding_controllers + + +- name: Cluster configuration + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.cluster + + +- name: Generate bootstrap configuration for synced edges + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - ./pnp_credentials.yml + - "{{ results_path_controllers }}" + roles: + - cisco.catalystwan.sync_pnp_edges + + +# Deploying edges requires vbond_mgmt_public_ip, otp and uuid! +- name: Deploy Edge devices based on generated boostrap configuration + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ deployment_edges_config }}" + roles: + - cisco.sdwan_deployment.azure_edges + + +# Onboard edge devices and wait for their reachability +- name: Activate and validate edge devices + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + roles: + - cisco.catalystwan.activate_edges + + +# Attach templates with running-config for all devices +- name: Set vmanage mode for all devices + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + vars: + edge_instances: "{{ deployed_edge_instances }}" + roles: + - cisco.catalystwan.vmanage_mode + +# After assigning templates, we should add check there to verify that device is managed by templates +# add to vmanage_mode role. + +# Health checks +- name: Verify control connections and BFD, OMP + hosts: localhost + gather_facts: false + vars_files: + - ./azure_sdwan_config.yml + - "{{ results_path_controllers }}" + - "{{ results_path_edges }}" + roles: + - cisco.catalystwan.health_checks diff --git a/playbooks/azure/full_deploy_and_configure.yml b/playbooks/azure/full_deploy_and_configure.yml index 7542875..23dcda1 100644 --- a/playbooks/azure/full_deploy_and_configure.yml +++ b/playbooks/azure/full_deploy_and_configure.yml @@ -27,20 +27,6 @@ - cisco.catalystwan.onboarding_controllers -- name: Cluster configuration - hosts: localhost - gather_facts: false - vars_files: - - ./azure_sdwan_config.yml - - ./pnp_credentials.yml - - "{{ results_path_controllers }}" - tasks: - - name: Configure cluster setup if required - ansible.builtin.include_role: - name: cisco.catalystwan.cluster - when: (vmanage_instances | first).cluster_private_ip is defined - - - name: Generate bootstrap configuration for synced edges hosts: localhost gather_facts: false From d69a319f4d184fd9005c98eea9b393a9fcf010fa Mon Sep 17 00:00:00 2001 From: przsus <101723670+przsus@users.noreply.github.com> Date: Tue, 29 Oct 2024 08:56:30 +0100 Subject: [PATCH 3/4] bump catalystwan version --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 150314d..b8516e8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -62,7 +62,7 @@ azure-storage-blob==12.13.0 bcrypt==4.1.2 boto3==1.34.78 botocore==1.34.78 -catalystwan==0.34.0.dev5 +catalystwan==0.35.5dev3 certifi==2024.2.2 cffi==1.16.0 charset-normalizer==3.3.2 From cc5f77ff8cb7e61f3c9a4777836f900023562f0f Mon Sep 17 00:00:00 2001 From: przsus <101723670+przsus@users.noreply.github.com> Date: Wed, 30 Oct 2024 08:50:58 +0100 Subject: [PATCH 4/4] bump version to 0.3.0 --- galaxy.yml | 2 +- playbooks/aws/aws_sdwan_config.yml | 1 + playbooks/azure/azure_sdwan_config.yml | 8 +++++++- requirements.yml | 4 ++-- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 16315d6..aab3d02 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -1,6 +1,6 @@ namespace: cisco name: sdwan -version: 0.2.2 +version: 0.3.0 readme: README.md authors: - Arkadiusz Cichon diff --git a/playbooks/aws/aws_sdwan_config.yml b/playbooks/aws/aws_sdwan_config.yml index f813792..4918f48 100644 --- a/playbooks/aws/aws_sdwan_config.yml +++ b/playbooks/aws/aws_sdwan_config.yml @@ -43,6 +43,7 @@ vmanage_instances: - hostname: "{{ aws_resources_prefix }}-vManage" system_ip: 192.168.1.1 site_id: 111 +# uncomment for cluster deployment # - hostname: "{{ aws_resources_prefix }}-vManage2" # system_ip: 192.168.4.1 # site_id: 112 diff --git a/playbooks/azure/azure_sdwan_config.yml b/playbooks/azure/azure_sdwan_config.yml index 0fd1953..ff7996d 100644 --- a/playbooks/azure/azure_sdwan_config.yml +++ b/playbooks/azure/azure_sdwan_config.yml @@ -41,7 +41,13 @@ vmanage_instances: - hostname: "{{ az_resources_prefix }}-vManage" system_ip: 192.168.1.1 site_id: "{{ site_id_vmanage }}" - +# uncomment for cluster deployment +# - hostname: "{{ az_resources_prefix }}-vManage2" +# system_ip: 192.168.4.1 +# site_id: "{{ site_id_vmanage | int + 1 }}" +# - hostname: "{{ az_resources_prefix }}-vManage3" +# system_ip: 192.168.5.1 +# site_id: "{{ site_id_vmanage | int + 2 }}" # vBond az_vbond_image_vhd_source: null diff --git a/requirements.yml b/requirements.yml index 1555851..ac4e3b7 100644 --- a/requirements.yml +++ b/requirements.yml @@ -4,6 +4,6 @@ collections: - name: azure.azcollection version: 1.19.0 - name: cisco.catalystwan - version: 0.2.3 + version: 0.3.0 - name: cisco.sdwan_deployment - version: 0.2.3 + version: 0.3.0