-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
120 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
namespace: cisco | ||
name: sdwan_deployment | ||
version: 0.3.3 | ||
version: 0.3.4 | ||
readme: README.md | ||
authors: | ||
- Arkadiusz Cichon <[email protected]> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Cisco Systems, Inc. and its affiliates | ||
|
||
--- | ||
|
||
galaxy_info: | ||
author: Przemyslaw Susko <[email protected]> | ||
description: Deploy Cisco SD-WAN cEdges (C8000V) on AWS | ||
license: GPL-3.0-or-later | ||
min_ansible_version: "2.16.6" | ||
|
||
galaxy_tags: | ||
- cisco | ||
- sdwan | ||
- catalystwan | ||
- networking | ||
|
||
dependencies: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# 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) | ||
|
||
--- | ||
|
||
- name: Get EIPs associated with the cEdge instances | ||
amazon.aws.ec2_eip_info: | ||
region: "{{ aws_region }}" | ||
filters: | ||
"tag:Creator": "{{ aws_tag_creator }}" | ||
tag:Machine: "*{{ hostname }}*" | ||
register: eip_info | ||
|
||
- name: Extract management public IP | ||
ansible.builtin.set_fact: | ||
mgmt_public_ip: "{{ (eip_info.addresses | selectattr('tags.VPN', 'equalto', '512') | map(attribute='public_ip') | first) | default(None) }}" | ||
transport_public_ip: "{{ (eip_info.addresses | selectattr('tags.VPN', 'equalto', '0') | map(attribute='public_ip') | first) | default(None) }}" | ||
|
||
- name: Set service_interfaces fact | ||
ansible.builtin.set_fact: | ||
service_interfaces: [] | ||
last_index: 2 | ||
|
||
- name: Append to service_interfaces | ||
ansible.builtin.set_fact: | ||
service_interfaces: "{{ service_interfaces + [{'addr': eip.private_ip_address, 'index': last_index}] }}" | ||
last_index: "{{ last_index | int + 1 }}" | ||
loop: "{{ eip_info.addresses }}" | ||
loop_control: | ||
loop_var: eip | ||
when: | ||
- eip.tags.VPN != '512' | ||
- eip.tags.VPN != '0' | ||
|
||
- name: Set instance fact | ||
ansible.builtin.set_fact: | ||
instance: | ||
hostname: "{{ hostname }}" | ||
admin_username: "admin" | ||
admin_password: "{{ admin_password }}" | ||
mgmt_public_ip: "{{ mgmt_public_ip }}" | ||
transport_public_ip: "{{ transport_public_ip }}" | ||
service_interfaces: "{{ service_interfaces }}" | ||
|
||
- name: Update deployment facts | ||
ansible.builtin.set_fact: | ||
deployment_facts: | ||
deployed_edge_instances: "{{ deployment_facts.deployed_edge_instances + [instance] }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# 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) | ||
|
||
--- | ||
|
||
- name: Gather network resources information | ||
ansible.builtin.include_role: | ||
name: cisco.sdwan_deployment.aws_network_infrastructure | ||
tasks_from: aws_gather_network_resources.yml | ||
|
||
- name: Gather information about EC2 instances with 'cedge' in their name | ||
amazon.aws.ec2_instance_info: | ||
region: "{{ aws_region }}" | ||
filters: | ||
"tag:Creator": "{{ aws_tag_creator }}" | ||
"tag:Name": "*vManage*" | ||
register: vmanage_ec2_info | ||
|
||
- name: Get EIPs associated with the vManage instances | ||
amazon.aws.ec2_eip_info: | ||
region: "{{ aws_region }}" | ||
filters: | ||
"tag:Creator": "{{ aws_tag_creator }}" | ||
tag:Machine: "*{{ vmanage_ec2_info.instances | map(attribute='tags.Name') | list | first }}*" | ||
register: vmanage_eip_info | ||
|
||
- name: Set manager authentication fact | ||
ansible.builtin.set_fact: | ||
manager_authentication: | ||
url: "{{ vmanage_eip_info.addresses | selectattr('tags.VPN', 'equalto', '512') | map(attribute='public_ip') | first }}" | ||
username: "admin" | ||
password: "{{ admin_password }}" | ||
|
||
- name: Define deployment facts | ||
ansible.builtin.set_fact: | ||
deployment_facts: | ||
deployed_edge_instances: [] | ||
|
||
- name: Gather information about EC2 instances with 'cedge' in their name | ||
amazon.aws.ec2_instance_info: | ||
region: "{{ aws_region }}" | ||
filters: | ||
"tag:Creator": "{{ aws_tag_creator }}" | ||
"tag:Name": "*cedge*" | ||
register: cedge_ec2_info | ||
|
||
- name: Get params for cEdge | ||
ansible.builtin.include_tasks: aws_cedge_ec2_instance.yml | ||
vars: | ||
hostname: "{{ host }}" | ||
loop: "{{ cedge_ec2_info.instances | map(attribute='tags.Name') | list }}" | ||
loop_control: | ||
loop_var: host |