Skip to content

Commit

Permalink
Functions to create/update firewall sections/rules and code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Yang Ding <[email protected]>
  • Loading branch information
Dyanngg committed Apr 23, 2019
1 parent d18db3f commit 0a3d9d5
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 63 deletions.
2 changes: 1 addition & 1 deletion functions/create_hosts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function create_controller_hosts {
echo "$controller_host" >> ctrl_vms
done

cat >> ctrl_vms <<-EOF
cat >> ctrl_vms <<-EOF
[controllers:vars]
prefix_length="${nsx_manager_deployment_ip_prefix_length_int}"
default_gateway="${default_gateway_int}"
Expand Down
12 changes: 0 additions & 12 deletions functions/create_tenant_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
def create_tenant_edge_params():
dns_domain = os.getenv('dns_domain_int')
edge_specs = os.getenv('tenant_edge_clusters_int')
# default_edge_ips = os.getenv('edge_ips')
# default_edge_prefix = os.getenv('edge_transport_node_prefix_int')
# default_edge_uplink_profile_vlan = os.getenv('edge_uplink_profile_vlan_int')
tenant_edge_clusters = json.loads(edge_specs)

with open('tenant_edges', 'w') as edge_output_file:
Expand Down Expand Up @@ -47,15 +44,6 @@ def create_tenant_edge_params():
edge_output_file.write('%s=%s\n' % (param, edge_cluster[param]))

cluster_member_spec = []
# default_edge_count = len(default_edge_ips.split(','))
# default_edge_members = "default-edge-cls members='["
# for i in range(default_edge_count):
# default_edge_members += "{\"transport_node_name\":\"%s-%s\"}," \
# % (default_edge_prefix, i + 1)
# default_edge_members = default_edge_members[:-1] + "]'"
# default_edge_members += " edge_uplink_profile_vlan=%s\n" % default_edge_uplink_profile_vlan
# cluster_member_spec.append(default_edge_members)

for idx, edge_cluster in enumerate(tenant_edge_clusters):
members_line = "edge-cls-%s members='[" % (idx + 1)
for i in range(len(edge_cluster['edge_ips'].split(','))):
Expand Down
10 changes: 5 additions & 5 deletions nsxt_yaml/basic_topology.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
password: "{{hostvars['localhost'].compute_manager_password}}"
state: present
retries: 3
delay: 3
delay: 10
register: compute_manager
until: compute_manager is defined
until: compute_manager is not failed

# TODO: change var names
- name: Deploy compute manager 2
Expand All @@ -127,9 +127,9 @@
state: present
register: compute_manager_2_compute_cluster
when:
- hostvars['localhost'].compute_manager_2_vcenter_ip is defined
- hostvars['localhost'].compute_manager_2_username is defined
- hostvars['localhost'].compute_manager_2_password is defined
- hostvars['localhost'].compute_manager_2_vcenter_ip is defined
- hostvars['localhost'].compute_manager_2_username is defined
- hostvars['localhost'].compute_manager_2_password is defined

- name: Install pyvmomi tools dependency
shell: "cd /tmp; git clone https://github.com/vmware/pyvmomi-community-samples.git; cp -r pyvmomi-community-samples/samples/tools /usr/local/lib/python2.7/dist-packages"
Expand Down
3 changes: 3 additions & 0 deletions pipelines/nsx-t-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ nsx_t_gen_params: &nsx-t-gen-params

nsx_t_ip_prefix_spec_int: ((nsx_t_ip_prefix_spec))
nsx_t_t0_bgp_spec_int: ((nsx_t_t0_bgp_spec))
nsx_t_ip_set_spec_int: ((nsx_t_ip_set_spec))
nsx_t_firewall_sections_spec_int: ((nsx_t_firewall_sections_spec))
nsx_t_edge_firewall_rules_spec_int: ((nsx_t_edge_firewall_rules_spec))
nsx_t_t1router_logical_switches_spec_int: ((nsx_t_t1router_logical_switches_spec))
nsx_t_ha_switching_profile_spec_int: ((nsx_t_ha_switching_profile_spec))
nsx_t_container_ip_block_spec_int: ((nsx_t_container_ip_block_spec))
Expand Down
Loading

0 comments on commit 0a3d9d5

Please sign in to comment.