|
| 1 | +# Copyright 2024 Cisco Systems, Inc. and its affiliates |
| 2 | +# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 3 | + |
| 4 | +--- |
| 5 | + |
| 6 | +- name: Gather network resources information |
| 7 | + ansible.builtin.include_role: |
| 8 | + name: cisco.sdwan_deployment.aws_network_infrastructure |
| 9 | + tasks_from: aws_gather_network_resources.yml |
| 10 | + |
| 11 | +- name: Gather information about EC2 instances with 'cedge' in their name |
| 12 | + amazon.aws.ec2_instance_info: |
| 13 | + region: "{{ aws_region }}" |
| 14 | + filters: |
| 15 | + "tag:Creator": "{{ aws_tag_creator }}" |
| 16 | + "tag:Name": "*vManage*" |
| 17 | + register: vmanage_ec2_info |
| 18 | + |
| 19 | +- name: Get EIPs associated with the vManage instances |
| 20 | + amazon.aws.ec2_eip_info: |
| 21 | + region: "{{ aws_region }}" |
| 22 | + filters: |
| 23 | + "tag:Creator": "{{ aws_tag_creator }}" |
| 24 | + tag:Machine: "*{{ vmanage_ec2_info.instances | map(attribute='tags.Name') | list | first }}*" |
| 25 | + register: vmanage_eip_info |
| 26 | + |
| 27 | +- name: Set manager authentication fact |
| 28 | + ansible.builtin.set_fact: |
| 29 | + manager_authentication: |
| 30 | + url: "{{ vmanage_eip_info.addresses | selectattr('tags.VPN', 'equalto', '512') | map(attribute='public_ip') | first }}" |
| 31 | + username: "admin" |
| 32 | + password: "{{ admin_password }}" |
| 33 | + |
| 34 | +- name: Define deployment facts |
| 35 | + ansible.builtin.set_fact: |
| 36 | + deployment_facts: |
| 37 | + deployed_edge_instances: [] |
| 38 | + |
| 39 | +- name: Gather information about EC2 instances with 'cedge' in their name |
| 40 | + amazon.aws.ec2_instance_info: |
| 41 | + region: "{{ aws_region }}" |
| 42 | + filters: |
| 43 | + "tag:Creator": "{{ aws_tag_creator }}" |
| 44 | + "tag:Name": "*cedge*" |
| 45 | + register: cedge_ec2_info |
| 46 | + |
| 47 | +- name: Get params for cEdge |
| 48 | + ansible.builtin.include_tasks: aws_cedge_ec2_instance.yml |
| 49 | + vars: |
| 50 | + hostname: "{{ host }}" |
| 51 | + loop: "{{ cedge_ec2_info.instances | map(attribute='tags.Name') | list }}" |
| 52 | + loop_control: |
| 53 | + loop_var: host |
0 commit comments