From 3bc3a8828c3ceefedd08e1767ae6e3bf2df9ac22 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Wed, 23 Aug 2017 15:05:02 +0800 Subject: Support multiple physnet mapping JIRA: COMPASS-559 1. support multiple mapping in provider_net_mappings of network.yml and create corresponding ovs bridges 2. support seperate config in sys_intf_mappings of network.yml 3. remove linux bridges in compute nodes for ovs port binding convenience 4. support openstack vlan tenant network 5. modify odl and odl_sfc roles to use configurable provider mapping 6. remove some hard coding Change-Id: Ib57484ce60d029f89c647fd5baf2c7af37c85d0b Signed-off-by: Harry Huang --- .../ansible/roles/post-openstack/tasks/main.yml | 72 ++++++++++++++-------- 1 file changed, 45 insertions(+), 27 deletions(-) (limited to 'deploy/adapters/ansible/roles/post-openstack/tasks/main.yml') diff --git a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml index 6a8299d6..4e2da1e0 100644 --- a/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml +++ b/deploy/adapters/ansible/roles/post-openstack/tasks/main.yml @@ -1,4 +1,4 @@ -############################################################################## +############################################################################# # Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. # # All rights reserved. This program and the accompanying materials @@ -7,35 +7,53 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: create network - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible create-network.yml > /dev/null" +- name: create external net + shell: | + . /root/openrc; + openstack network create --external \ + --provider-physical-network {{ public_net_info.provider_network }} \ + --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; + when: + - public_net_info.enable == "True" + - public_net_info.type == "flat" -- name: create flavor - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible create-flavor.yml > /dev/null" +- name: create external net + shell: | + . /root/openrc; + openstack network create --external \ + --network-segment {{ public_net_info.segment_id }} \ + --provider-physical-network {{ public_net_info.provider_network }} \ + --provider-network-type {{ public_net_info.type }} {{ public_net_info.network }}; + when: + - public_net_info.enable == "True" + - public_net_info.type == "vlan" -- name: run ansible yml to fetch openrc - shell: "export ANSIBLE_LOG_PATH=/var/ansible/run/openstack_ocata-opnfv2/ansible.log; \ - cd /opt/openstack-ansible/playbooks; \ - openstack-ansible fetch-files.yml > /dev/null" +- name: create external subnet + shell: | + . /root/openrc; + openstack subnet create --network "{{ public_net_info.network }}" \ + --allocation-pool \ + start={{ public_net_info.floating_ip_start }},end={{ public_net_info.floating_ip_end }} \ + --gateway "{{ public_net_info.external_gw }}" \ + --subnet-range "{{ public_net_info.floating_ip_cidr }}" \ + "{{ public_net_info.subnet }}" -- name: replace http with https in openrc - replace: - dest: /opt/openrc - regexp: "http://" - replace: "https://" +- name: create openstack flavors + shell: | + . /root/openrc; + openstack flavor create {{ item.name }} \ + --id {{ item.id }} --ram {{ item.ram }} \ + --disk {{ item.disk }} --vcpus {{ item.vcpus }} || true + with_items: "{{ flavors }}" -- name: replace internalURL with publicURL in openrc - replace: +- name: fetch openrc + fetch: + src: /root/openrc dest: /opt/openrc - regexp: "{{ internal_vip['ip'] }}" - replace: "{{ public_vip['ip'] }}" + flat: "yes" -- name: change the endpoint type - replace: - dest: /opt/openrc - regexp: "internalURL" - replace: "publicURL" +- name: fetch haproxy.cert + fetch: + src: /etc/ssl/certs/haproxy.cert + dest: /opt/os_cacert + flat: "yes" -- cgit 1.2.3-korg