diff options
author | Harry Huang <huangxiangyu5@huawei.com> | 2017-08-23 15:05:02 +0800 |
---|---|---|
committer | Harry Huang <huangxiangyu5@huawei.com> | 2017-09-01 16:31:01 +0800 |
commit | 3bc3a8828c3ceefedd08e1767ae6e3bf2df9ac22 (patch) | |
tree | 7413e99b2d9ddbadc782a5e9f68a6f1ba35570b1 /deploy/adapters/ansible/roles/post-openstack | |
parent | 292985dab007c3ee1c3481c985871a3483d9f7bc (diff) |
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 <huangxiangyu5@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/roles/post-openstack')
-rw-r--r-- | deploy/adapters/ansible/roles/post-openstack/tasks/main.yml | 72 |
1 files changed, 45 insertions, 27 deletions
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" |