diff options
Diffstat (limited to 'deploy/adapters')
49 files changed, 495 insertions, 501 deletions
diff --git a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml index 5e729cf3..f328d959 100644 --- a/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml +++ b/deploy/adapters/ansible/openstack/HA-ansible-multinodes.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: all remote_user: root @@ -223,6 +232,12 @@ remote_user: root max_fail_percentage: 0 roles: +# - tacker + +- hosts: controller + remote_user: root + max_fail_percentage: 0 + roles: - openstack-post - hosts: controller diff --git a/deploy/adapters/ansible/openstack/allinone.yml b/deploy/adapters/ansible/openstack/allinone.yml index e8597434..2ea54c6b 100644 --- a/deploy/adapters/ansible/openstack/allinone.yml +++ b/deploy/adapters/ansible/openstack/allinone.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: controller sudo: "True" diff --git a/deploy/adapters/ansible/openstack/compute.yml b/deploy/adapters/ansible/openstack/compute.yml index 7a1488f3..f0c33754 100644 --- a/deploy/adapters/ansible/openstack/compute.yml +++ b/deploy/adapters/ansible/openstack/compute.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: all remote_user: vagrant diff --git a/deploy/adapters/ansible/openstack/controller.yml b/deploy/adapters/ansible/openstack/controller.yml index e6c52733..17b65d8f 100644 --- a/deploy/adapters/ansible/openstack/controller.yml +++ b/deploy/adapters/ansible/openstack/controller.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: controller remote_user: root diff --git a/deploy/adapters/ansible/openstack/multinodes.yml b/deploy/adapters/ansible/openstack/multinodes.yml index 4bd22936..0ef33e25 100644 --- a/deploy/adapters/ansible/openstack/multinodes.yml +++ b/deploy/adapters/ansible/openstack/multinodes.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: database sudo: "True" diff --git a/deploy/adapters/ansible/openstack/network.yml b/deploy/adapters/ansible/openstack/network.yml index 8e4ec439..5248be0f 100644 --- a/deploy/adapters/ansible/openstack/network.yml +++ b/deploy/adapters/ansible/openstack/network.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: all remote_user: vagrant diff --git a/deploy/adapters/ansible/openstack/single-controller.yml b/deploy/adapters/ansible/openstack/single-controller.yml index e7f6900d..fe0e3e64 100644 --- a/deploy/adapters/ansible/openstack/single-controller.yml +++ b/deploy/adapters/ansible/openstack/single-controller.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: controller sudo: "True" diff --git a/deploy/adapters/ansible/openstack/storage.yml b/deploy/adapters/ansible/openstack/storage.yml index 6a6bd34c..f4eaa6de 100644 --- a/deploy/adapters/ansible/openstack/storage.yml +++ b/deploy/adapters/ansible/openstack/storage.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - hosts: all remote_user: vagrant diff --git a/deploy/adapters/ansible/openstack/templates/nova.conf b/deploy/adapters/ansible/openstack/templates/nova.conf index b648b030..3cd2c03b 100644 --- a/deploy/adapters/ansible/openstack/templates/nova.conf +++ b/deploy/adapters/ansible/openstack/templates/nova.conf @@ -3,6 +3,11 @@ {% set _ = memcached_servers.append('%s:11211'% host) %} {% endfor %} {% set memcached_servers = memcached_servers|join(',') %} +{% if ansible_processor_vcpus > 10 %} +{% set api_workers = ansible_processor_vcpus // 10 %} +{% else %} +{% set api_workers = 1 %} +{% endif %} [DEFAULT] dhcpbridge_flagfile=/etc/nova/nova.conf @@ -38,11 +43,8 @@ notify_on_state_change = vm_and_task_state notification_driver = nova.openstack.common.notifier.rpc_notifier notification_driver = ceilometer.compute.nova_notifier memcached_servers = {{ memcached_servers }} - -{% if ansible_processor_vcpus > 20 %} -osapi_compute_workers = 20 -metadata_workers = 20 -{% endif %} +osapi_compute_workers = {{ api_workers }} +metadata_workers = {{ api_workers }} [database] # The SQLAlchemy connection string used to connect to the database diff --git a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf index 05a1c8fd..8b035653 100644 --- a/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf +++ b/deploy/adapters/ansible/roles/cinder-controller/templates/cinder.conf @@ -3,6 +3,11 @@ {% set _ = memcached_servers.append('%s:11211'% host) %} {% endfor %} {% set memcached_servers = memcached_servers|join(',') %} +{% if ansible_processor_vcpus > 5 %} +{% set api_workers = ansible_processor_vcpus // 5 %} +{% else %} +{% set api_workers = 1 %} +{% endif %} [DEFAULT] rootwrap_config = /etc/cinder/rootwrap.conf @@ -35,9 +40,7 @@ quota_driver = cinder.quota.DbQuotaDriver osapi_volume_listen = {{ storage_controller_host }} osapi_volume_listen_port = 8776 -{% if ansible_processor_vcpus > 30 %} -osapi_volume_workers = 30 -{% endif %} +osapi_volume_workers = {{ api_workers }} db_backend = sqlalchemy volume_name_template = volume-%s diff --git a/deploy/adapters/ansible/roles/database/files/remove_user.sh b/deploy/adapters/ansible/roles/database/files/remove_user.sh index 88b1518d..dc0b43fa 100755..100644 --- a/deploy/adapters/ansible/roles/database/files/remove_user.sh +++ b/deploy/adapters/ansible/roles/database/files/remove_user.sh @@ -1,4 +1,13 @@ #!/bin/sh +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + mysql -uroot -Dmysql <<EOF use mysql; delete from user where user=''; diff --git a/deploy/adapters/ansible/roles/heat/templates/heat.j2 b/deploy/adapters/ansible/roles/heat/templates/heat.j2 index a7856103..d73bd70b 100644 --- a/deploy/adapters/ansible/roles/heat/templates/heat.j2 +++ b/deploy/adapters/ansible/roles/heat/templates/heat.j2 @@ -3,6 +3,11 @@ {% set _ = memcached_servers.append('%s:11211'% host) %} {% endfor %} {% set memcached_servers = memcached_servers|join(',') %} +{% if ansible_processor_vcpus > 5 %} +{% set api_workers = ansible_processor_vcpus // 5 %} +{% else %} +{% set api_workers = 1 %} +{% endif %} [DEFAULT] heat_metadata_server_url = http://{{ internal_vip.ip }}:8000 @@ -12,14 +17,10 @@ log_dir = /var/log/heat stack_domain_admin = heat_domain_admin stack_domain_admin_password = {{ HEAT_PASS }} stack_user_domain_name = heat -{% if ansible_processor_vcpus > 30 %} -num_engine_workers = 30 -{% endif %} +num_engine_workers = {{ api_workers}} [heat_api] -{% if ansible_processor_vcpus > 30 %} -workers = 30 -{% endif %} +workers = {{ api_workers }} [database] connection = mysql://heat:{{ HEAT_DBPASS }}@{{ db_host }}/heat diff --git a/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py b/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py index d510bcf4..e01c1ff7 100644 --- a/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py +++ b/deploy/adapters/ansible/roles/moon/files/get_deb_depends.py @@ -1,4 +1,13 @@ #!/usr/bin/env python3 +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import sys import subprocess diff --git a/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml b/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml index f918344b..7842a73c 100644 --- a/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml +++ b/deploy/adapters/ansible/roles/nova-compute/tasks/main.yml @@ -34,6 +34,54 @@ shell: egrep -c '(vmx|svm)' /proc/cpuinfo || echo 0 register: kvm_cpu_num +- name: update libvirt-bin conf + lineinfile: + dest: /etc/default/libvirt-bin + regexp: '^libvirtd_opts=.*' + insertafter: '^#libvirtd_opts=.*' + line: 'libvirtd_opts="-d -l"' + when: ansible_os_family == "Debian" + notify: + - restart nova-compute services + +- name: update libvirt-bin.conf + lineinfile: + dest: /etc/init/libvirt-bin.conf + regexp: '^env libvirtd_opts=.*' + line: 'env libvirtd_opts="-d -l"' + when: ansible_os_family == "Debian" + notify: + - restart nova-compute services + +- name: update libvirtd.conf + lineinfile: + dest: /etc/libvirt/libvirtd.conf + regexp: '{{ item.regexp }}' + insertafter: '{{ item.insertafter }}' + line: '{{ item.line }}' + with_items: + - regexp: '^listen_tls.*' + insertafter: '^#listen_tls.*' + line: 'listen_tls = 0' + - regexp: '^listen_tcp.*' + insertafter: '^#listen_tcp.*' + line: 'listen_tcp = 1' + - regexp: '^auth_tcp.*' + insertafter: '^#auth_tcp.*' + line: 'auth_tcp = "none"' + notify: + - restart nova-compute services + +- name: update sysconfig libvirtd + lineinfile: + dest: /etc/sysconfig/libvirtd + regexp: '^LIBVIRTD_ARGS.*' + insertafter: '^#LIBVIRTD_ARGS.*' + line: 'LIBVIRTD_ARGS="--listen"' + when: ansible_os_family == "RedHat" + notify: + - restart nova-compute services + - name: update nova-compute conf template: src={{ item }} dest=/etc/nova/{{ item }} with_items: diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network.py b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network.py index 3e7d5cbf..2b15f4a2 100755..100644 --- a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network.py +++ b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import netaddr import os diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py index 07ccba1f..0f7e32a5 100755..100644 --- a/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py +++ b/deploy/adapters/ansible/roles/odl_cluster/files/recover_network_odl_l3.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import netaddr import os diff --git a/deploy/adapters/ansible/roles/odl_cluster/files/setup_networks_odl_l3.py b/deploy/adapters/ansible/roles/odl_cluster/files/setup_networks_odl_l3.py index 45e475df..74032d19 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/files/setup_networks_odl_l3.py +++ b/deploy/adapters/ansible/roles/odl_cluster/files/setup_networks_odl_l3.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import netaddr import os diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml index 816e435a..9592a0ae 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_02_unarchive_odl_and_jdk.yml @@ -8,13 +8,19 @@ ############################################################################## --- +- name: clear jdk8 package + command: su -s /bin/sh -c "rm -rf /opt/install_jdk8" + - name: unarchive onos driver package - command: su -s /bin/sh -c "tar xvf /opt/install_jdk8.tar -C /opt/" + command: su -s /bin/sh -c "tar xvf /opt/install_jdk8.tar -C /opt/" - name: install install_jdk8 package command: su -s /bin/sh -c "/opt/install_jdk8/install_jdk8.sh" +- name: clear odl package + command: su -s /bin/sh -c "rm -rf {{ odl_home }}/*" + - name: extract odl package command: | su -s /bin/sh -c "tar xzf /opt/{{ odl_pkg_name }} -C {{ odl_home }} \ - --strip-components 1 --no-overwrite-dir -k --skip-old-files" odl + --strip-components 1" odl diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml index 41aca7ee..0d4043e0 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_03_copy_odl_configuration_files.yml @@ -50,11 +50,6 @@ command: su -s /bin/sh -c "/opt/acl_conf.sh;" - name: create tomcat config - template: - src: tomcat-server.xml - dest: "{{ odl_home }}/configuration/tomcat-server.xml" - -- name: create tomcat config - template: - src: jetty.xml - dest: "{{ odl_home }}/etc/jetty.xml" + shell: > + sed -i 's/port="8282"/port="{{ odl_api_port }}"/' + {{ odl_home }}configuration/tomcat-server.xml diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml index f9015ffc..fa418c6c 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_04_install_pip_packages.yml @@ -13,9 +13,8 @@ cd /opt tar xf /opt/{{ networking_odl_pkg_name }} rm -rf /opt/{{ networking_odl_pkg_name }} - sed -i 's/^neutron-lib.*/neutron-lib/' networking-odl-3.2.0/requirements.txt - tar zcf /opt/{{ networking_odl_pkg_name }} networking-odl-3.2.0 - rm -rf networking-odl-3.2.0 + sed -i 's/^neutron-lib.*/neutron-lib/' {{ odl_pip }}/requirements.txt + tar zcf /opt/{{ networking_odl_pkg_name }} {{ odl_pip }} cd - - name: odl pip package install diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml index 7fc10e7d..30ee61fb 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_06_stop_openstack_services.yml @@ -20,3 +20,15 @@ - name: turn off keepalived on control node service: name=keepalived state=stopped when: ansible_os_family == "Debian" + +- name: stop neutron l3 agent + service: name=neutron-l3-agent state=stopped enabled=no + when: odl_l3_agent == "Enable" and inventory_hostname in groups['odl'] + +- name: remove neutron l3 agent + shell: > + sed -i '/neutron-l3-agent/d' /opt/service; + rm -rf /lib/systemd/system/neutron-l3-agent.service; + rm -rf /etc/init/neutron-l3-agent.conf; + rm -rf /etc/init.d/neutron-l3-agent; + when: odl_l3_agent == "Enable" and inventory_hostname in groups['odl'] diff --git a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_08_configure_neutron.yml b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_08_configure_neutron.yml index 5135c8cf..80443f1b 100644 --- a/deploy/adapters/ansible/roles/odl_cluster/tasks/01_08_configure_neutron.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/tasks/01_08_configure_neutron.yml @@ -38,17 +38,6 @@ force_metadata "True"; when: odl_l3_agent == "Enable" -- name: stop neutron l3 agent - service: name=neutron-l3-agent state=stopped enabled=no - when: odl_l3_agent == "Enable" and inventory_hostname in groups['odl'] - -- name: remove neutron l3 agent - shell: > - sed -i '/neutron-l3-agent/d' /opt/service; - rm -rf /lib/systemd/system/neutron-l3-agent.service; - rm -rf /etc/init/neutron-l3-agent.conf; - rm -rf /etc/init.d/neutron-l3-agent; - when: odl_l3_agent == "Enable" and inventory_hostname in groups['odl'] - name: drop and recreate neutron database shell: | diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/acl_conf.sh b/deploy/adapters/ansible/roles/odl_cluster/templates/acl_conf.sh index d05f33e5..4962a17c 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/acl_conf.sh +++ b/deploy/adapters/ansible/roles/odl_cluster/templates/acl_conf.sh @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# Copyright (c) 2017 HUAWEI TECHNOLOGIES CO.,LTD and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf b/deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf deleted file mode 100755 index 77798498..00000000 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/akka.conf +++ /dev/null @@ -1,105 +0,0 @@ - -odl-cluster-data { - bounded-mailbox { - mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox" - mailbox-capacity = 1000 - mailbox-push-timeout-time = 100ms - } - - metric-capture-enabled = true - - akka { - loglevel = "INFO" - loggers = ["akka.event.slf4j.Slf4jLogger"] - - actor { - - provider = "akka.cluster.ClusterActorRefProvider" - serializers { - java = "akka.serialization.JavaSerializer" - proto = "akka.remote.serialization.ProtobufSerializer" - } - - serialization-bindings { - "com.google.protobuf.Message" = proto - - } - } - remote { - log-remote-lifecycle-events = off - netty.tcp { - hostname = "{{ hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address }}" - port = 2550 - maximum-frame-size = 419430400 - send-buffer-size = 52428800 - receive-buffer-size = 52428800 - } - } - - cluster { - seed-nodes = [ -{% for host in groups['odl'] %} - {% if loop.last %} - "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2550" - {% else %} - "akka.tcp://opendaylight-cluster-data@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2550", - {% endif %} -{% endfor %} - ] - - auto-down-unreachable-after = 10s - - roles = [ -{% set key = 0 %} -{% for host in groups['odl'] %} - {% set key = key + 1 %} - {% if hostvars[host]['ansible_' + internal_nic].ipv4.address == hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address %} - "member-{{ key }}" - {% endif %} -{% endfor %} - ] - - } - } -} - -odl-cluster-rpc { - bounded-mailbox { - mailbox-type = "org.opendaylight.controller.cluster.common.actor.MeteredBoundedMailbox" - mailbox-capacity = 1000 - mailbox-push-timeout-time = 100ms - } - - metric-capture-enabled = true - - akka { - loglevel = "INFO" - loggers = ["akka.event.slf4j.Slf4jLogger"] - - actor { - provider = "akka.cluster.ClusterActorRefProvider" - - } - remote { - log-remote-lifecycle-events = off - netty.tcp { - hostname = "{{ hostvars[inventory_hostname]['ansible_' + internal_nic].ipv4.address }}" - port = 2551 - } - } - - cluster { - seed-nodes = [ -{% for host in groups['odl'] %} - {% if loop.last %} - "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2551" - {% else %} - "akka.tcp://odl-cluster-rpc@{{ hostvars[host]['ansible_' + internal_nic].ipv4.address }}:2551", - {% endif %} -{% endfor %} - ] - - auto-down-unreachable-after = 10s - } - } -} diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/jetty.xml b/deploy/adapters/ansible/roles/odl_cluster/templates/jetty.xml deleted file mode 100755 index 064e8a89..00000000 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/jetty.xml +++ /dev/null @@ -1,106 +0,0 @@ -<?xml version="1.0"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting// -DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> - -<Configure class="org.eclipse.jetty.server.Server"> - - <!-- =========================================================== --> - <!-- Set connectors --> - <!-- =========================================================== --> - <!-- One of each type! --> - <!-- =========================================================== --> - - <!-- Use this connector for many frequently idle connections and for - threadless continuations. --> - <Call name="addConnector"> - <Arg> - <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> - <Set name="host"> - <Property name="jetty.host" /> - </Set> - <Set name="port"> - <Property name="jetty.port" default="8181" /> - </Set> - <Set name="maxIdleTime">300000</Set> - <Set name="Acceptors">2</Set> - <Set name="statsOn">false</Set> - <Set name="confidentialPort">8543</Set> - <Set name="lowResourcesConnections">20000</Set> - <Set name="lowResourcesMaxIdleTime">5000</Set> - </New> - </Arg> - </Call> - <Call name="addConnector"> - <Arg> - <New class="org.eclipse.jetty.server.nio.SelectChannelConnector"> - <Set name="host"> - <Property name="jetty.host" /> - </Set> - <Set name="port"> - <Property name="jetty.port" default="8080" /> - </Set> - <Set name="maxIdleTime">300000</Set> - <Set name="Acceptors">2</Set> - <Set name="statsOn">false</Set> - <Set name="confidentialPort">8443</Set> - <Set name="lowResourcesConnections">20000</Set> - <Set name="lowResourcesMaxIdleTime">5000</Set> - </New> - </Arg> - </Call> - - <!-- =========================================================== --> - <!-- Configure Authentication Realms --> - <!-- Realms may be configured for the entire server here, or --> - <!-- they can be configured for a specific web app in a context --> - <!-- configuration (see $(jetty.home)/contexts/test.xml for an --> - <!-- example). --> - <!-- =========================================================== --> - <Call name="addBean"> - <Arg> - <New class="org.eclipse.jetty.plus.jaas.JAASLoginService"> - <Set name="name">karaf</Set> - <Set name="loginModuleName">karaf</Set> - <Set name="roleClassNames"> - <Array type="java.lang.String"> - <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal - </Item> - </Array> - </Set> - </New> - </Arg> - </Call> - <Call name="addBean"> - <Arg> - <New class="org.eclipse.jetty.plus.jaas.JAASLoginService"> - <Set name="name">default</Set> - <Set name="loginModuleName">karaf</Set> - <Set name="roleClassNames"> - <Array type="java.lang.String"> - <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal - </Item> - </Array> - </Set> - </New> - </Arg> - </Call> - -</Configure> diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg.Redhat b/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg.Redhat index 0691a984..3ffe830e 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg.Redhat +++ b/deploy/adapters/ansible/roles/odl_cluster/templates/org.apache.karaf.features.cfg.Redhat @@ -36,22 +36,12 @@ # # Comma separated list of features repositories to register by default # -featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.4.2-Beryllium-SR2/xml/features -#featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.4.0-Beryllium/xml/features -#featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.4.0-Beryllium-RC1/xml/features -#mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.3.3-Lithium-SR3/xml/features -#mvn:org.apache.karaf.features/standard/3.0.3/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.3/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.1.4/xml/features,mvn:org.apache.karaf.features/spring/3.0.3/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.3.2-Lithium-SR2/xml/features +featuresRepositories = mvn:org.apache.karaf.features/standard/3.0.7/xml/features,mvn:org.apache.karaf.features/enterprise/3.0.7/xml/features,mvn:org.ops4j.pax.web/pax-web-features/3.2.9/xml/features,mvn:org.apache.karaf.features/spring/3.0.7/xml/features,mvn:org.opendaylight.integration/features-integration-index/0.5.2-Boron-SR2/xml/features # # Comma separated list of features to install at startup # -#featuresBoot=config,standard,region,package,kar,ssh,management,odl-restconf-all,odl-aaa-authn,odl-dlux-all,odl-ovsdb-openstack -featuresBoot=config,standard,region,package,kar,ssh,management,odl-ovsdb-openstack - -#,odl-restconf-all,odl-aaa-authn,odl-dlux-all - -# odl-base-all,odl-restconf,odl-ovsdb-openstack,odl-dlux-all,odl-mdsal-apidocs -#,odl-mdsal-clustering,odl-openflowplugin-flow-services +featuresBoot=config,standard,region,package,kar,ssh,management,odl-restconf-all,odl-aaa-authn,odl-dlux-all,odl-ovsdb-openstack,odl-mdsal-apidocs,odl-dlux-core,odl-openflowplugin-nxm-extensions # # Defines if the boot features are started in asynchronous mode (in a dedicated thread) diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/settings.xml b/deploy/adapters/ansible/roles/odl_cluster/templates/settings.xml deleted file mode 100755 index 5ba3b50c..00000000 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/settings.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- vi: set et smarttab sw=2 tabstop=2: --> -<!-- - Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. - - This program and the accompanying materials are made available under the - terms of the Eclipse Public License v1.0 which accompanies this distribution, - and is available at http://www.eclipse.org/legal/epl-v10.html ---> -<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> - <localRepository>{{ odl_home }}/system/ </localRepository> - <profiles> - <profile> - <id>opendaylight-release</id> - <repositories> - <repository> - <id>opendaylight-mirror</id> - <name>opendaylight-mirror</name> - <url>https://nexus.opendaylight.org/content/repositories/public/</url> - <releases> - <enabled>true</enabled> - <updatePolicy>never</updatePolicy> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </repository> - </repositories> - <pluginRepositories> - <pluginRepository> - <id>opendaylight-mirror</id> - <name>opendaylight-mirror</name> - <url>https://nexus.opendaylight.org/content/repositories/public/</url> - <releases> - <enabled>true</enabled> - <updatePolicy>never</updatePolicy> - </releases> - <snapshots> - <enabled>false</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - </profile> - - <profile> - <id>opendaylight-snapshots</id> - <repositories> - <repository> - <id>opendaylight-snapshot</id> - <name>opendaylight-snapshot</name> - <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </repository> - </repositories> - <pluginRepositories> - <pluginRepository> - <id>opendaylight-snapshot</id> - <name>opendaylight-snapshot</name> - <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url> - <releases> - <enabled>false</enabled> - </releases> - <snapshots> - <enabled>true</enabled> - </snapshots> - </pluginRepository> - </pluginRepositories> - </profile> - </profiles> - - <activeProfiles> - <activeProfile>opendaylight-release</activeProfile> - <activeProfile>opendaylight-snapshots</activeProfile> - </activeProfiles> -</settings> diff --git a/deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml b/deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml deleted file mode 100755 index bc7ab13d..00000000 --- a/deploy/adapters/ansible/roles/odl_cluster/templates/tomcat-server.xml +++ /dev/null @@ -1,61 +0,0 @@ -<?xml version='1.0' encoding='utf-8'?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<Server> - <!--APR library loader. Documentation at /docs/apr.html --> - <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> - <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> - <Listener className="org.apache.catalina.core.JasperListener" /> - <!-- Prevent memory leaks due to use of particular java/javax APIs--> - <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> - <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> - <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> - - <Service name="Catalina"> - <Connector port="{{ odl_api_port }}" protocol="HTTP/1.1" - connectionTimeout="20000" - redirectPort="8443" /> - -<!-- - Please remove the comments around the following Connector tag to enable HTTPS Authentication support. - Remember to add a valid keystore in the configuration folder. - More info : http://tomcat.apache.org/tomcat-7.0-doc/ssl-howto.html#Configuration ---> - - <!-- - <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" - maxThreads="150" scheme="https" secure="true" - clientAuth="false" sslProtocol="TLS" - keystoreFile="configuration/keystore" - keystorePass="changeit"/> - --> - - <Engine name="Catalina" defaultHost="localhost"> - <Host name="localhost" appBase="" - unpackWARs="false" autoDeploy="false" - deployOnStartup="false" createDirs="false"> - <Realm className="org.opendaylight.controller.karafsecurity.ControllerCustomRealm" /> - <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> - <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" - prefix="web_access_log_" suffix=".txt" resolveHosts="false" - rotatable="true" fileDateFormat="yyyy-MM" - pattern="%{yyyy-MM-dd HH:mm:ss.SSS z}t - [%a] - %r"/> - </Host> - </Engine> - </Service> -</Server> - diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml index 65666203..c78c5221 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/Debian.yml @@ -18,4 +18,4 @@ service_file: src: opendaylight.service dst: /lib/systemd/system/opendaylight.service -networking_odl_pkg_name: networking-odl-3.2.0.tar.gz +# networking_odl_pkg_name: networking-odl-3.2.0.tar.gz diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml index ef92dff6..a2e6d01d 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/RedHat.yml @@ -15,5 +15,5 @@ service_ovs_name: openvswitch service_ovs_agent_name: neutron-openvswitch-agent service_file: - src: opendaylight - dst: /etc/init.d/opendaylight + src: opendaylight.service + dst: /lib/systemd/system/opendaylight.service diff --git a/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml b/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml index fac2a11e..a968e3ec 100755 --- a/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster/vars/main.yml @@ -51,5 +51,6 @@ jdk8_script_name: install_jdk8.tar common_packages_noarch: [] -odl_pip: - - networking_odl +odl_pip: networking-odl-3.2.0 + +networking_odl_pkg_name: networking-odl-3.2.0.tar.gz diff --git a/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml index 3024dcf1..07ed958a 100755..100644 --- a/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster_neutron/tasks/main.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - name: restart neutron-server service: name=neutron-server state=restarted enabled=yes diff --git a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml index 8432186c..5efc1bad 100644 --- a/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml +++ b/deploy/adapters/ansible/roles/odl_cluster_post/tasks/main.yml @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + --- - name: restart opendaylight shell: sleep 60; service opendaylight restart; sleep 300; diff --git a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/check_network.py b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/check_network.py index a7e3b2fd..be3c552a 100644 --- a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/check_network.py +++ b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/check_network.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import sys import subprocess diff --git a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/log.py b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/log.py index a22ff0fe..422931bc 100644 --- a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/log.py +++ b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/log.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import logging import os loggers = {} diff --git a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/setup_networks.py b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/setup_networks.py index 404c2064..ab13e088 100644 --- a/deploy/adapters/ansible/roles/setup-network/files/setup_networks/setup_networks.py +++ b/deploy/adapters/ansible/roles/setup-network/files/setup_networks/setup_networks.py @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2016 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + import yaml import netaddr import os diff --git a/deploy/adapters/ansible/roles/tacker/files/tacker.conf b/deploy/adapters/ansible/roles/tacker/files/tacker.conf new file mode 100644 index 00000000..0c90dcb9 --- /dev/null +++ b/deploy/adapters/ansible/roles/tacker/files/tacker.conf @@ -0,0 +1,36 @@ +description "OpenStack Tacker Server" +author "Yifei Xue <xueyifei@huawei.com>" + +start on runlevel [2345] +stop on runlevel [!2345] + +chdir /var/run + +respawn +respawn limit 20 5 +limit nofile 65535 65535 + +pre-start script + for i in lock run log lib ; do + mkdir -p /var/$i/tacker + chown root /var/$i/tacker + done +end script + +script + [ -x "/usr/local/bin/tacker-server" ] || exit 0 + DAEMON_ARGS="" + CONFIG_FILE="/usr/local/etc/tacker/tacker.conf" + USE_SYSLOG="" + USE_LOGFILE="" + NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG="" + [ -r /etc/default/openstack ] && . /etc/default/openstack + [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB + [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog" + [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=/var/log/tacker/tacker.log" + [ -z "$NO_OPENSTACK_CONFIG_FILE_DAEMON_ARG" ] && DAEMON_ARGS="$DAEMON_ARGS --config-file=$CONFIG_FILE" + + exec start-stop-daemon --start --chdir /var/lib/tacker \ + --chuid root:root --make-pidfile --pidfile /var/run/tacker/tacker.pid \ + --exec /usr/local/bin/tacker-server -- ${DAEMON_ARGS} +end script diff --git a/deploy/adapters/ansible/roles/tacker/files/tacker.service b/deploy/adapters/ansible/roles/tacker/files/tacker.service new file mode 100644 index 00000000..5fd61916 --- /dev/null +++ b/deploy/adapters/ansible/roles/tacker/files/tacker.service @@ -0,0 +1,19 @@ +[Unit] +Description=OpenStack Tacker Server +After= + +[Service] +User=root +Group=root +Type=simple +WorkingDirectory=/var/lib/tacker +PermissionsStartOnly=true +ExecStartPre=/bin/mkdir -p /var/lock/tacker /var/log/tacker /var/lib/tacker +ExecStartPre=/usr/bin/touch /var/log/tacker/tacker.log +ExecStart=/usr/local/bin/tacker-server --config-file /usr/local/etc/tacker/tacker.conf +Restart=on-failure +LimitNOFILE=65535 +TimeoutStopSec=15 + +[Install] +WantedBy=multi-user.target diff --git a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml index 2d37ff13..f2c39bd7 100755 --- a/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml +++ b/deploy/adapters/ansible/roles/tacker/tasks/tacker_controller.yml @@ -7,46 +7,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## --- -- name: get http server - shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf - register: http_server - -- name: creat tacker_home, tacker_client_home, tacker_horizon_home - shell: | - mkdir -p /opt/tacker; - mkdir -p /opt/tacker_client; - mkdir -p /opt/tacker_horizon; - -- name: download tacker package - get_url: - url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_pkg_name }}" - dest: /opt/{{ tacker_pkg_name }} - -- name: download tacker_client package - get_url: - url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_client_pkg_name }}" - dest: /opt/{{ tacker_client_pkg_name }} - -- name: download tacker_horizon package - get_url: - url: "http://{{ http_server.stdout_lines[0] }}/packages/tacker/{{ tacker_horizon_pkg_name }}" - dest: /opt/{{ tacker_horizon_pkg_name }} - -- name: extract tacker package - command: | - su -s /bin/sh -c "tar xzf /opt/{{ tacker_pkg_name }} -C {{ tacker_home }} \ - --strip-components 1 --no-overwrite-dir -k --skip-old-files" - -- name: extract tacker_client package - command: | - su -s /bin/sh -c "tar xzf /opt/{{ tacker_client_pkg_name }} -C {{ tacker_client_home }} \ - --strip-components 1 --no-overwrite-dir -k --skip-old-files" - -- name: extract tacker_horizon package - command: | - su -s /bin/sh -c "tar xzf /opt/{{ tacker_horizon_pkg_name }} -C {{ tacker_horizon_home }} \ - --strip-components 1 --no-overwrite-dir -k --skip-old-files" - - name: edit ml2_conf.ini shell: | crudini --set /etc/neutron/plugins/ml2/ml2_conf.ini ml2 extension_drivers port_security; @@ -65,7 +25,7 @@ - name: "combination of the haproxy configuration" shell: "cat /tmp/haproxy-tacker.cfg >> /etc/haproxy/haproxy.cfg" - when: ha_cfg.stdout.find('8888') == -1 + when: ha_cfg.stdout.find('9890') == -1 - name: "delete temporary configuration file" file: @@ -136,29 +96,39 @@ shell: | . /opt/admin-openrc.sh; \ openstack endpoint create --region RegionOne \ - --publicurl 'http://{{ public_vip.ip }}:8888/' \ - --adminurl 'http://{{ internal_vip.ip }}:8888/' \ - --internalurl 'http://{{ internal_vip.ip }}:8888/' tacker + nfv-orchestration public 'http://{{ public_vip.ip }}:9890/'; + openstack endpoint create --region RegionOne \ + nfv-orchestration admin 'http://{{ internal_vip.ip }}:9890/'; + openstack endpoint create --region RegionOne \ + nfv-orchestration internal 'http://{{ internal_vip.ip }}:9890/'; when: inventory_hostname == haproxy_hosts.keys()[0] -- name: install pip package - pip: name=Babel state=present version=2.3.4 - -- name: install pip packages - shell: | - pip install tosca-parser heat-translator oslosphinx; - -- name: install tacker +- name: install tacker and tacker client shell: | - . /opt/admin-openrc.sh; cd {{ tacker_home }}; python setup.py install + pip install tacker python-tackerclient -- name: create 'tacker' directory in '/var/cache', set ownership and permissions +- name: create 'tacker' directory in '/var/cache' shell: | mkdir -p /var/cache/tacker - name: create 'tacker' directory in '/var/log' shell: mkdir -p /var/log/tacker +- name: get the policy file of heat + shell: cat /etc/heat/policy.json | grep Flavor + register: heat_info + +- name: update the policy file of heat + lineinfile: + dest: /etc/heat/policy.json + regexp: ' "resource_types:OS::Nova::Flavor' + line: ' "resource_types:OS::Nova::Flavor": "role:admin",' + when: heat_info.stdout.find('role') == -1 + +- name: restart heat services + service: name={{ item }} state=restarted enabled=yes + with_items: "{{ heat_services }}" + - name: copy tacker configs template: src={{ item.src }} dest=/opt/os_templates with_items: "{{ tacker_configs_templates }}" @@ -175,29 +145,67 @@ --config-file /usr/local/etc/tacker/tacker.conf upgrade head when: inventory_hostname == haproxy_hosts.keys()[0] -- name: install tacker client - shell: | - . /opt/admin-openrc.sh; cd {{ tacker_client_home }}; - python setup.py install +- name: create tacker service + copy: src=tacker.service dest=/lib/systemd/system/ + +- name: create tacker service work dir + file: path=/var/lib/tacker state=directory + +- name: link the tacker service + file: + src: /lib/systemd/system/tacker.service + dest: /etc/systemd/system/multi-user.target.wants/tacker.service + state: link + +- name: start tacker service + shell: service tacker start + +- name: create tackerc file + template: src=tackerc.sh dest=/opt/tackerc.sh mode=777 + +- name: create nfvrc file + template: src=nfvrc.sh dest=/opt/nfvrc.sh mode=777 + +- name: get the nfv_user info + shell: . /opt/tackerc.sh; openstack user list + register: nfvuser_info + +- name: delete the existed nfv user + shell: . /opt/tackerc.sh; openstack user delete nfv_user + when: nfvuser_info.stdout.find('nfv') != -1 and inventory_hostname == haproxy_hosts.keys()[0] + +- name: get the openstack project info + shell: . /opt/tackerc.sh; openstack project list + register: nfvproject_info -- name: install tacker horizon +- name: delete the existed nfv project shell: | - . /opt/admin-openrc.sh; cd {{ tacker_horizon_home }}; - python setup.py install + . /opt/tackerc.sh; + openstack project delete $(openstack project list | grep nfv | awk '{print $2}') + when: nfvproject_info.stdout.find('nfv') != -1 and inventory_hostname == haproxy_hosts.keys()[0] -- name: enable tacker horizon in dashboard +- name: create an nfv project + shell: . /opt/tackerc.sh; openstack project create --description "NFV Project" nfv + when: inventory_hostname == haproxy_hosts.keys()[0] + +- name: create nfv user with admin privileges shell: | - cp {{ tacker_horizon_home }}/openstack_dashboard_extensions/* \ - /usr/share/openstack-dashboard/openstack_dashboard/enabled/ + . /opt/tackerc.sh; + openstack user create --password console nfv_user; + openstack role add --project nfv --user nfv_user admin; + when: inventory_hostname == haproxy_hosts.keys()[0] + +- name: create config.yml + template: src=config.yaml dest=/opt/config.yaml -- name: restart apache server - shell: service apache2 restart +- name: check if tacker running + shell: . /opt/tackerc.sh; while (!(tacker ext-list)); do sleep 30; done -- name: launch tacker-server +- name: register VIM to tacker shell: | - . /opt/admin-openrc.sh; \ - python /usr/local/bin/tacker-server \ - --config-file /usr/local/etc/tacker/tacker.conf | - --log-file /var/log/tacker/tacker.log - async: 9999999999999 - poll: 0 + . /opt/tackerc.sh; + tacker vim-register --config-file /opt/config.yaml --description "Default VIM" VIM0 + when: inventory_hostname == haproxy_hosts.keys()[0] + +- name: restart tacker service + shell: service tacker stop; service tacker start diff --git a/deploy/adapters/ansible/roles/tacker/templates/config.yaml b/deploy/adapters/ansible/roles/tacker/templates/config.yaml new file mode 100644 index 00000000..0a0cea66 --- /dev/null +++ b/deploy/adapters/ansible/roles/tacker/templates/config.yaml @@ -0,0 +1,8 @@ +--- + +auth_url: http://{{ public_vip.ip }}:5000/v3 +username: nfv_user +password: console +project_name: nfv +project_domain_name: default +user_domain_name: default diff --git a/deploy/adapters/ansible/roles/tacker/templates/haproxy-tacker-cfg.j2 b/deploy/adapters/ansible/roles/tacker/templates/haproxy-tacker-cfg.j2 index 93bbe798..6cb294ac 100644 --- a/deploy/adapters/ansible/roles/tacker/templates/haproxy-tacker-cfg.j2 +++ b/deploy/adapters/ansible/roles/tacker/templates/haproxy-tacker-cfg.j2 @@ -1,10 +1,10 @@ listen proxy-tacker_api_cluster - bind {{ internal_vip.ip }}:8888 - bind {{ public_vip.ip }}:8888 + bind {{ internal_vip.ip }}:9890 + bind {{ public_vip.ip }}:9890 mode tcp option tcp-check option tcplog balance source {% for host,ip in haproxy_hosts.items() %} - server {{ host }} {{ ip }}:8888 weight 1 check inter 2000 rise 2 fall 5 + server {{ host }} {{ ip }}:9890 weight 1 check inter 2000 rise 2 fall 5 {% endfor %} diff --git a/deploy/adapters/ansible/roles/tacker/templates/nfvrc.sh b/deploy/adapters/ansible/roles/tacker/templates/nfvrc.sh new file mode 100644 index 00000000..b8074052 --- /dev/null +++ b/deploy/adapters/ansible/roles/tacker/templates/nfvrc.sh @@ -0,0 +1,14 @@ +#!/bin/sh +export LC_ALL=C +export OS_NO_CACHE=true +export OS_TENANT_NAME=nfv +export OS_PROJECT_NAME=nfv +export OS_USERNAME=nfv_user +export OS_PASSWORD=console +export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v3 +export OS_PROJECT_DOMAIN_NAME=default +export OS_USER_DOMAIN_NAME=default +export OS_AUTH_STRATEGY=keystone +export OS_REGION_NAME=RegionOne +export OS_IDENTITY_API_VERSION=3 +export OS_IMAGE_API_VERSION=2 diff --git a/deploy/adapters/ansible/roles/tacker/templates/tacker.j2 b/deploy/adapters/ansible/roles/tacker/templates/tacker.j2 index ae0f644a..89c8fea1 100644 --- a/deploy/adapters/ansible/roles/tacker/templates/tacker.j2 +++ b/deploy/adapters/ansible/roles/tacker/templates/tacker.j2 @@ -1,3 +1,12 @@ +{% set memcached_servers = [] %} +{% set rabbitmq_servers = [] %} +{% for host in haproxy_hosts.values() %} +{% set _ = memcached_servers.append('%s:11211'% host) %} +{% set _ = rabbitmq_servers.append('%s:5672'% host) %} +{% endfor %} +{% set memcached_servers = memcached_servers|join(',') %} +{% set rabbitmq_servers = rabbitmq_servers|join(',') %} + [DEFAULT] # Print more verbose output (set logging level to INFO instead of default WARNING level). verbose = True @@ -38,7 +47,7 @@ use_syslog = False bind_host = {{ internal_ip }} # Port the bind the API server to -bind_port = 8888 +bind_port = 9890 # Path to the extensions. Note that this can be a colon-separated list of # paths. For example: @@ -333,6 +342,10 @@ signing_dir = /var/cache/tacker #project_domain_id = default project_name = service #user_domain_id = default +project_domain_name = default +user_domain_name = default +region_name = RegionOne +memcached_servers = {{ memcached_servers }} password = console username = tacker auth_url = http://{{ internal_vip.ip }}:35357 @@ -398,14 +411,10 @@ connection = mysql://tacker:TACKER_DBPASS@{{ internal_vip.ip }}:3306/tacker?char # mgmt_driver = noop,openwrt # Specify drivers for monitoring -# monitor_driver = ping, http_ping - -[nfvo_vim] -# Supported VIM drivers, resource orchestration controllers such as OpenStack, kvm -#Default VIM driver is OpenStack -#vim_drivers = openstack -#Default VIM placement if vim id is not provided -default_vim = VIM0 +monitor_driver = ping, http_ping + +[nfvo] +vim_drivers = openstack [vim_keys] #openstack = /etc/tacker/vim/fernet_keys diff --git a/deploy/adapters/ansible/roles/tacker/templates/tackerc.sh b/deploy/adapters/ansible/roles/tacker/templates/tackerc.sh new file mode 100644 index 00000000..83dc188a --- /dev/null +++ b/deploy/adapters/ansible/roles/tacker/templates/tackerc.sh @@ -0,0 +1,14 @@ +#!/bin/sh +export LC_ALL=C +export OS_NO_CACHE=true +export OS_TENANT_NAME=service +export OS_PROJECT_NAME=service +export OS_USERNAME=tacker +export OS_PASSWORD=console +export OS_AUTH_URL=http://{{ internal_vip.ip }}:35357/v3 +export OS_PROJECT_DOMAIN_NAME=default +export OS_USER_DOMAIN_NAME=default +export OS_AUTH_STRATEGY=keystone +export OS_REGION_NAME=RegionOne +export OS_IDENTITY_API_VERSION=3 +export OS_IMAGE_API_VERSION=2 diff --git a/deploy/adapters/ansible/roles/tacker/vars/Debian.yml b/deploy/adapters/ansible/roles/tacker/vars/Debian.yml index 59a4dbd9..039e1680 100755 --- a/deploy/adapters/ansible/roles/tacker/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/tacker/vars/Debian.yml @@ -12,3 +12,8 @@ packages: - crudini services: [] + +heat_services: + - heat-api + - heat-api-cfn + - heat-engine diff --git a/deploy/adapters/ansible/roles/tacker/vars/main.yml b/deploy/adapters/ansible/roles/tacker/vars/main.yml index 601f3721..c934090c 100755 --- a/deploy/adapters/ansible/roles/tacker/vars/main.yml +++ b/deploy/adapters/ansible/roles/tacker/vars/main.yml @@ -7,12 +7,6 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -tacker_pkg_name: tacker-0.3.1.tar.gz -tacker_client_pkg_name: python-tackerclient-0.3.1.tar.gz -tacker_horizon_pkg_name: tacker-horizon-0.3.1.tar.gz -tacker_home: /opt/tacker/ -tacker_client_home: /opt/tacker_client/ -tacker_horizon_home: /opt/tacker_horizon/ tacker_configs_templates: - src: tacker.j2 diff --git a/deploy/adapters/cobbler/snippets/kickstart_chef_run.sh b/deploy/adapters/cobbler/snippets/kickstart_chef_run.sh index 6b2e0301..b76b0d18 100644 --- a/deploy/adapters/cobbler/snippets/kickstart_chef_run.sh +++ b/deploy/adapters/cobbler/snippets/kickstart_chef_run.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2015 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #set ip_address = "" #set ikeys = $interfaces.keys() #for $iname in $ikeys diff --git a/deploy/adapters/cobbler/snippets/preseed_chef_run.sh b/deploy/adapters/cobbler/snippets/preseed_chef_run.sh index 19d7eee3..8f6cc69b 100644 --- a/deploy/adapters/cobbler/snippets/preseed_chef_run.sh +++ b/deploy/adapters/cobbler/snippets/preseed_chef_run.sh @@ -1,3 +1,12 @@ +############################################################################## +# Copyright (c) 2015 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + #set ip_address = "" #set ikeys = $interfaces.keys() #for $iname in $ikeys diff --git a/deploy/adapters/cobbler/triggers/sync/post/migrate_ks.py b/deploy/adapters/cobbler/triggers/sync/post/migrate_ks.py index 9ef8a26c..5eec46d6 100644 --- a/deploy/adapters/cobbler/triggers/sync/post/migrate_ks.py +++ b/deploy/adapters/cobbler/triggers/sync/post/migrate_ks.py @@ -1,4 +1,13 @@ #!/usr/bin/python +############################################################################## +# Copyright (c) 2015 HUAWEI TECHNOLOGIES CO.,LTD and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + """script to migrate rendered kickstart files from cobbler to outside.""" import logging |