Edit the docker file and adjust HA yml 97/23397/8
authorliyuenan <liyuenan@huawei.com>
Thu, 20 Oct 2016 02:41:59 +0000 (10:41 +0800)
committerliyuenan <liyuenan@huawei.com>
Mon, 24 Oct 2016 10:13:05 +0000 (18:13 +0800)
JIRA: COMPASS-491

Change-Id: Ibca46dca0ca614b9a6e7eb3fe5b9d5c8ca26c006
Signed-off-by: liyuenan <liyuenan@huawei.com>
12 files changed:
build/templates/Debian_xenial_newton.tmpl
deploy/adapters/ansible/openstack_newton_xenial/HA-ansible-multinodes.yml
deploy/adapters/ansible/openstack_newton_xenial/roles/apache/tasks/main.yml [deleted file]
deploy/adapters/ansible/openstack_newton_xenial/roles/apache/templates/ports.conf.j2 [deleted file]
deploy/adapters/ansible/openstack_newton_xenial/roles/glance/tasks/nfs.yml
deploy/adapters/ansible/openstack_newton_xenial/roles/keystone/tasks/keystone_install.yml
deploy/adapters/ansible/openstack_newton_xenial/roles/keystone/vars/Debian.yml
deploy/adapters/ansible/openstack_newton_xenial/roles/keystone/vars/main.yml
deploy/adapters/ansible/openstack_newton_xenial/roles/neutron-controller/tasks/neutron_install.yml [new file with mode: 0644]
deploy/adapters/ansible/openstack_newton_xenial/roles/odl_cluster/files/odl-aaa-moon.tar.gz [deleted file]
deploy/adapters/ansible/openstack_newton_xenial/roles/swift/files/swift-lib.tar.gz [deleted file]
deploy/compass_vm.sh

index e10d4e2..84f2870 100644 (file)
@@ -5,7 +5,8 @@ set -ex
 
 # add openstack $OPV repo
 apt-get update && apt-get install -y software-properties-common
-# sudo add-apt-repository -y cloud-archive:$OPV
+add-apt-repository -y cloud-archive:$OPV
+apt-get update && apt-get -y dist-upgrade
 apt-get install -d nova-compute-kvm -y
 
 #make pernoca database
index 9e8ec15..9be0c38 100644 (file)
   max_fail_percentage: 0
   roles:
     - memcached
+    - apache
     - database
     - mq
     - keystone
-    - apache
     - nova-controller
     - neutron-controller
     - cinder-controller
diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/apache/tasks/main.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/apache/tasks/main.yml
deleted file mode 100755 (executable)
index ad1d544..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-##############################################################################
-# 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
-##############################################################################
----
-- include_vars: "{{ ansible_os_family }}.yml"
-
-- name: install packages
-  action: "{{ ansible_pkg_mgr }} name={{ item }} state=latest update_cache=yes"
-  with_items: packages | union(packages_noarch)
-  when ansible_os_family != 'Debian'
-
-- name: assure listen port exist
-  template:
-    dest: '{{ apache_config_dir }}/ports.conf'
-    src: ports.conf.j2
-  notify:
-    - restart apache related services
-
-- name: remove default listen port on centos
-  lineinfile:
-    dest: /etc/httpd/conf/httpd.conf
-    state: absent
-    regexp: 'Listen 80'
-  when: ansible_os_family == 'RedHat'
-
-- meta: flush_handlers
diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/apache/templates/ports.conf.j2 b/deploy/adapters/ansible/openstack_newton_xenial/roles/apache/templates/ports.conf.j2
deleted file mode 100644 (file)
index f6c9c8b..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-Listen {{ internal_ip }}:80
-Listen {{ internal_ip }}:5000
-Listen {{ internal_ip }}:35357
index 07dfacd..1d13bfe 100644 (file)
 - name: get mount info
   command: mount
   register: mount_info
+  tags:
+    - recovery
 
 - name: get nfs server
   shell: awk -F'=' '/compass_server/ {print $2}' /etc/compass.conf
   register: ip_info
+  tags:
+    - recovery
 
 - name: restart host nfs service
   service: name={{ item }} state=restarted enabled=yes
@@ -59,3 +63,5 @@
   when: mount_info.stdout.find('images') == -1
   retries: 5
   delay: 3
+  tags:
+    - recovery
index 79d0272..8ff087c 100644 (file)
@@ -66,7 +66,7 @@
 - name: update apache2 configs
   template:
     src: wsgi-keystone.conf.j2
-    dest: '{{ apache_config_dir }}/sites-available/wsgi-keystone.conf'
+    dest: '{{ apache_config_dir }}/sites-available/keystone.conf'
   when: ansible_os_family == 'Debian'
   notify:
     - restart keystone services
 - name: update apache2 configs
   template:
     src: wsgi-keystone.conf.j2
-    dest: '{{ apache_config_dir }}/wsgi-keystone.conf'
+    dest: '{{ apache_config_dir }}/keystone.conf'
   when: ansible_os_family == 'RedHat'
   notify:
     - restart keystone services
 
 - name: enable keystone server
   file:
-    src: "{{ apache_config_dir }}/sites-available/wsgi-keystone.conf"
-    dest: "{{ apache_config_dir }}/sites-enabled/wsgi-keystone.conf"
+    src: "{{ apache_config_dir }}/sites-available/keystone.conf"
+    dest: "{{ apache_config_dir }}/sites-enabled/keystone.conf"
     state: "link"
   when: ansible_os_family == 'Debian'
   notify:
index 6000c6f..89bfbe0 100644 (file)
 cron_path: "/var/spool/cron/crontabs"
 
 packages:
-  - keystone
   - apache2
   - libapache2-mod-wsgi
   - python-keystone
   - python-openstackclient
+  - keystone
 
 services:
   - apache2
diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/neutron-controller/tasks/neutron_install.yml b/deploy/adapters/ansible/openstack_newton_xenial/roles/neutron-controller/tasks/neutron_install.yml
new file mode 100644 (file)
index 0000000..0a30af7
--- /dev/null
@@ -0,0 +1,49 @@
+##############################################################################
+# 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
+##############################################################################
+---
+- include_vars: "{{ ansible_os_family }}.yml"
+
+- name: disable auto start
+  copy:
+    content: "#!/bin/sh\nexit 101"
+    dest: "/usr/sbin/policy-rc.d"
+    mode: 0755
+  when: ansible_os_family == "Debian"
+
+- name: install controller-related neutron packages
+  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+  with_items: packages | union(packages_noarch)
+
+- name: enable auto start
+  file:
+    path=/usr/sbin/policy-rc.d
+    state=absent
+  when: ansible_os_family == "Debian"
+
+- name: generate neutron control service list
+  lineinfile: dest=/opt/service create=yes line='{{ item }}'
+  with_items: services | union(services_noarch)
+
+- name: get tenant id to fill neutron.conf
+  shell: openstack project show \
+             --os-username=admin \
+             --os-password=console \
+             --os-auth-url=http://{{ internal_vip.ip }}:35357/v2.0 \
+             --os-tenant-name=admin \
+             service | grep id | awk '{print $4}'
+  register: NOVA_ADMIN_TENANT_ID
+
+- name: update neutron conf
+  template: src=templates/neutron.conf dest=/etc/neutron/neutron.conf backup=yes
+
+- name: update ml2 plugin conf
+  template: src=templates/ml2_conf.ini dest=/etc/neutron/plugins/ml2/ml2_conf.ini backup=yes
+
+- name: ln plugin.ini
+  file: src=/etc/neutron/plugins/ml2/ml2_conf.ini dest=/etc/neutron/plugin.ini state=link
diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/odl_cluster/files/odl-aaa-moon.tar.gz b/deploy/adapters/ansible/openstack_newton_xenial/roles/odl_cluster/files/odl-aaa-moon.tar.gz
deleted file mode 100644 (file)
index dd03749..0000000
Binary files a/deploy/adapters/ansible/openstack_newton_xenial/roles/odl_cluster/files/odl-aaa-moon.tar.gz and /dev/null differ
diff --git a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/files/swift-lib.tar.gz b/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/files/swift-lib.tar.gz
deleted file mode 100644 (file)
index fdbb38f..0000000
Binary files a/deploy/adapters/ansible/openstack_newton_xenial/roles/swift/files/swift-lib.tar.gz and /dev/null differ
index 33e309c..94b103f 100755 (executable)
@@ -53,18 +53,21 @@ function exec_cmd_on_compass() {
 }
 
 function _inject_dashboard_conf() {
-    if [[ "$ENABLE_UBUNTU_THEME" == "true" ]]; then
-        cmd="
-            sed -i '/enable_ubuntu_theme/d' /etc/compass/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl; \
-            echo enable_ubuntu_theme: True >> /etc/compass/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl
-        "
-    else
-        cmd="
-            sed -i '/enable_ubuntu_theme/d' /etc/compass/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl; \
-            echo enable_ubuntu_theme: False >> /etc/compass/templates/ansible_installer/openstack_mitaka/vars/HA-ansible-multinodes.tmpl
-        "
-    fi
-    exec_cmd_on_compass $cmd
+    for os in mitaka mitaka_xenial newton_xenial; do
+        CONF_TEMPLATES_DIR=/etc/compass/templates/ansible_installer/openstack_$os/vars
+        if [[ "$ENABLE_UBUNTU_THEME" == "true" ]]; then
+            cmd="
+                sed -i '/enable_ubuntu_theme/d' ${CONF_TEMPLATES_DIR}/HA-ansible-multinodes.tmpl; \
+                echo enable_ubuntu_theme: True >> ${CONF_TEMPLATES_DIR}/HA-ansible-multinodes.tmpl
+            "
+        else
+            cmd="
+                sed -i '/enable_ubuntu_theme/d' ${CONF_TEMPLATES_DIR}/HA-ansible-multinodes.tmpl; \
+                echo enable_ubuntu_theme: False >> ${CONF_TEMPLATES_DIR}/HA-ansible-multinodes.tmpl
+            "
+        fi
+        exec_cmd_on_compass $cmd
+    done
 }
 
 function inject_compass_conf() {