aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/roles/post-openstack
diff options
context:
space:
mode:
Diffstat (limited to 'deploy/adapters/ansible/roles/post-openstack')
-rw-r--r--deploy/adapters/ansible/roles/post-openstack/tasks/main.yml72
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"