From 02708db0054bcabf4db151d4b364d70ecc44ef18 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Tue, 25 Jul 2017 17:01:04 +0800 Subject: Adapt network.yml to OpenStack Ansible JIRA:COMPASS-557 1. modify sys_intf_mappings and ip_settings in network.yml to synchronize with OSA network. networks compass build will be mgmt, external, tenant, storage. 2. modify compass_conf to support new netwok.yml 3. fix some hard coding when transfer ip parameters 4. support heterogeneous network Change-Id: Ib4a8af1f96a40e6456242e3dc2b456e0c8c17c2e Signed-off-by: Harry Huang --- .../ansible/roles/config-osa/files/setup-ovs.yml | 2 +- .../templates/openstack_user_config.yml.j2 | 31 +++++++++++++--------- .../config-osa/templates/user_variables.yml.j2 | 4 +-- 3 files changed, 21 insertions(+), 16 deletions(-) (limited to 'deploy/adapters/ansible/roles/config-osa') diff --git a/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml b/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml index 9f65cd5d..e906ed45 100644 --- a/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml +++ b/deploy/adapters/ansible/roles/config-osa/files/setup-ovs.yml @@ -32,7 +32,7 @@ dest: /etc/neutron/plugins/ml2/openvswitch_agent.ini regexp: '^bridge_mappings' insertafter: '^bridge_mappings' - line: "local_ip = {{hostvars[inventory_hostname]['ansible_br_vxlan']['ipv4']['address']}}" + line: "local_ip = {{hostvars[inventory_hostname]['ansible_br_tenant']['ipv4']['address']}}" notify: - Restart neutron-openvswitch-agent when: diff --git a/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 index 2a24113b..d69674f2 100644 --- a/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 +++ b/deploy/adapters/ansible/roles/config-osa/templates/openstack_user_config.yml.j2 @@ -1,20 +1,25 @@ --- cidr_networks: - container: 10.1.0.0/24 - tunnel: 172.29.240.0/22 - storage: 172.16.2.0/24 + container: {{ mgmt_cidr }} + tunnel: {{ tenant_cidr }} + storage: {{ storage_cidr }} used_ips: - - "10.1.0.1,10.1.0.55" - - "10.1.0.100,10.1.0.110" - - "172.29.240.1,172.29.240.50" - - "172.16.2.1,172.16.2.50" - - "172.29.248.1,172.29.248.50" +{% for item in network_cfg["ip_settings"] %} + - "{{ ','.join(item["ip_ranges"][0]) }}" +{% if item["name"] == "mgmt" %} + - "{{ ','.join(item["dhcp_ranges"][0]) }}" +{% endif %} +{% if "gw" in item %} + - "{{ item["gw"] }}" +{% endif %} +{% endfor %} + - "{{ internal_vip.ip }}" global_overrides: - internal_lb_vip_address: 10.1.0.22 + internal_lb_vip_address: {{ internal_vip.ip }} external_lb_vip_address: {{ public_vip.ip }} - tunnel_bridge: "br-vxlan" + tunnel_bridge: "br-tenant" management_bridge: "br-mgmt" provider_networks: - network: @@ -29,7 +34,7 @@ global_overrides: is_container_address: true is_ssh_address: true - network: - container_bridge: "br-vxlan" + container_bridge: "br-tenant" container_type: "veth" container_interface: "eth10" ip_from_q: "tunnel" @@ -43,7 +48,7 @@ global_overrides: - neutron_openvswitch_agent {% endif %} - network: - container_bridge: "br-vlan" + container_bridge: "br-external" container_type: "veth" container_interface: "eth12" host_bind_override: "eth12" @@ -56,7 +61,7 @@ global_overrides: - neutron_openvswitch_agent {% endif %} - network: - container_bridge: "br-vlan" + container_bridge: "br-external" container_type: "veth" container_interface: "eth11" type: "vlan" diff --git a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 index 7f29d5fe..2b4a959a 100644 --- a/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 +++ b/deploy/adapters/ansible/roles/config-osa/templates/user_variables.yml.j2 @@ -22,8 +22,8 @@ debug: false haproxy_keepalived_external_vip_cidr: "{{ public_vip.ip }}/32" -haproxy_keepalived_internal_vip_cidr: "10.1.0.22/32" -haproxy_keepalived_external_interface: br-vlan +haproxy_keepalived_internal_vip_cidr: "{{ internal_vip.ip }}/32" +haproxy_keepalived_external_interface: br-external haproxy_keepalived_internal_interface: br-mgmt keepalived_ping_address: "{{ ntp_server }}" -- cgit 1.2.3-korg