Skip to content

Commit df8fd92

Browse files
authored
Fixes for cluster deployments (#36)
* Fix for rerunning of AWS cluster deployment * Add missing NSG rules for Azure cluster deployment * Fix linter errors
1 parent f317135 commit df8fd92

File tree

3 files changed

+32
-1
lines changed

3 files changed

+32
-1
lines changed

.ansible-lint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exclude_paths:
2121
- playbooks/template_cloudinit_config.yml
2222
- playbooks/specific_edges_to_teardown.yml
2323
- roles/aws_teardown/tasks/main.yml
24+
- .ansible
2425
# parseable: true
2526
# quiet: true
2627
# strict: true

roles/aws_edges/tasks/aws_cedge_ec2_instance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
- name: Set aws_network_interfaces fact with a list of interfaces for cEdge device
4040
ansible.builtin.set_fact:
41-
aws_network_interfaces: "{{ network_interfaces_cedge.results | map(attribute='interface') | list }}"
41+
aws_network_interfaces: "{{ network_interfaces_cedge.results | selectattr('interface', 'defined') | map(attribute='interface') | list }}"
4242

4343
- name: Filter aws_network_interfaces for instance creation. Set aws_mgmt_nic and aws_transport_nic facts
4444
ansible.builtin.set_fact:

roles/azure_controllers/tasks/azure_vmanage_vm.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,36 @@
107107
- cluster_subnet is defined
108108
- cluster_subnet != ""
109109

110+
- name: "Get info about NSG: {{ az_network_security_group }}"
111+
azure.azcollection.azure_rm_securitygroup_info:
112+
resource_group: "{{ az_resource_group }}"
113+
name: "{{ az_network_security_group }}"
114+
register: az_res_gr
115+
when:
116+
- cluster_subnet is defined
117+
- cluster_subnet != ""
118+
119+
- name: "Extend Network Security Group for cluster deployment. NSG: {{ az_network_security_group }}"
120+
azure.azcollection.azure_rm_securitygroup:
121+
resource_group: "{{ az_resource_group }}"
122+
name: "{{ az_network_security_group }}"
123+
rules:
124+
- name: "{{ cluster_vmanage_nic.state.name }}"
125+
protocol: "*"
126+
destination_port_range: "*"
127+
source_port_range: "*"
128+
source_address_prefix: "{{ cluster_vmanage_nic.state.ip_configuration.private_ip_address }}"
129+
access: Allow
130+
priority: "{{ 2500 + ((az_res_gr.securitygroups | first).rules | length) + 1 }}"
131+
direction: Inbound
132+
tags:
133+
Name: "{{ az_network_security_group }}"
134+
Creator: "{{ az_tag_creator }}"
135+
Organization: "{{ organization_name }}"
136+
when:
137+
- cluster_subnet is defined
138+
- cluster_subnet != ""
139+
110140
- name: Set az_network_interfaces_vmanage fact with a list of interfaces for vmanage
111141
ansible.builtin.set_fact:
112142
az_network_interfaces_vmanage: "{{ (vmanage_nics.results + [cluster_vmanage_nic]) | selectattr('state', 'defined') | map(attribute='state') | list }}"

0 commit comments

Comments
 (0)