NewFeature: add moon in Compass 17/17317/1
authorchenshuai@huawei.com <chenshuai@huawei.com>
Thu, 21 Jul 2016 09:38:08 +0000 (05:38 -0400)
committerchenshuai@huawei.com <chenshuai@huawei.com>
Thu, 21 Jul 2016 09:38:08 +0000 (05:38 -0400)
JIRA: COMPASS-443

Change-Id: If792ca91af9ad7cddfee5d4ad5355655385f1913
Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
deploy/adapters/ansible/openstack_mitaka_xenial/HA-ansible-multinodes.yml
deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/keystone-moon-install.yml [new file with mode: 0644]
deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/main.yml [new file with mode: 0644]
deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/Debian.yml [new file with mode: 0644]
deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/main.yml [new file with mode: 0644]

index 0f84d97..d374086 100644 (file)
   roles:
     - odl_cluster_post
 
+- hosts: controller
+  remote_user: root
+  accelerate: true
+  max_fail_percentage: 0
+  roles:
+    - moon
+
 - hosts: controller
   remote_user: root
   accelerate: true
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/keystone-moon-install.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/keystone-moon-install.yml
new file mode 100644 (file)
index 0000000..71315f8
--- /dev/null
@@ -0,0 +1,73 @@
+
+# Note (asteroide): this part is specific but when Keystone-Moon packages will be installed in a true repository
+#                   we will not have to do that.
+
+- name: download keystone-moon packages
+  get_url: url=https://github.com/dthom/moon-bin/archive/master.zip dest=/tmp/master.zip mode=0444
+
+- name: extract keystone-moon packages
+  unarchive: src=/tmp/master.zip dest=/tmp copy=no
+
+# Pre-Configuration of the Keystone package
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/auth-token value={{ ADMIN_TOKEN }} vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-password value={{ ADMIN_PASS }} vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-password-confirm value={{ ADMIN_PASS }} vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/register-endpoint value=false vtype="boolean"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/region-name value="regionOne" vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-user value="admin" vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/create-admin-tenant value=false vtype="boolean"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/configure_db value=false vtype="boolean"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-tenant-name value="admin" vtype="string"
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-role-name value="admin" vtype="string"
+
+#  debconf: name=keystone question=keystone/endpoint-ip:
+
+- name: pre-configure Keystone
+  debconf: name=keystone question=keystone/admin-email value="root@localhost" vtype="string"
+
+# install dependencies
+
+- name: install keystone-moon dependencies
+  shell: "apt-get install `python3 scripts/get_deb_depends.py /tmp/moon-bin-master/keystone*.deb`"
+  when: ansible_os_family == "Debian"
+
+- name: install keystone-moon packages
+  shell: "cd /tmp/moon-bin-master; dpkg --force-depends -i *.deb"
+  when: ansible_os_family == "Debian"
+
+- name: install keystone-moon packages
+  shell: "cd /tmp/moon-bin-master; rpm -i *.rpm"
+  when: ansible_os_family == "RedHat"
+
+- name: update keystone conf
+  template: src=keystone.conf dest=/etc/keystone/keystone.conf backup=yes
+  notify:
+    - restart keystone services
+
+# Note (asteroide): the next task is really specific to Moon
+
+- name: update keystone-paste.ini
+  template: src=keystone-paste.ini dest=/etc/keystone/keystone-paste.ini backup=yes
+  notify:
+    - restart keystone services
+
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/main.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/main.yml
new file mode 100644 (file)
index 0000000..31802e1
--- /dev/null
@@ -0,0 +1,37 @@
+##############################################################################
+# 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 keystone package dependencies
+  action: "{{ ansible_pkg_mgr }} name={{ item }} state=present"
+  with_items: packages | union(packages_noarch)
+
+- include: keystone-moon-install.yml
+
+
+
+
+- name: enable auto start
+  file:
+    path=/usr/sbin/policy-rc.d
+    state=absent
+  when: ansible_os_family == "Debian"
+
+- name: restart keystone services
+  service: name={{ item }} state=restarted enabled=yes
+  with_items: services | union(services_noarch)
+
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/Debian.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/Debian.yml
new file mode 100644 (file)
index 0000000..42177d4
--- /dev/null
@@ -0,0 +1,92 @@
+##############################################################################
+# 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
+##############################################################################
+---
+
+packages:
+  - python-cryptography
+  - python-dateutil
+  - python-dogpile.cache
+  - python-eventlet
+  - python-greenlet
+  - python-jsonschema
+  - python-keystoneclient
+  - python-keystonemiddleware
+  - python-ldap
+  - python-ldappool
+  - python-lxml
+  - python-memcache
+  - python-migrate
+  - python-msgpack
+  - python-mysqldb
+  - python-oauthlib
+  - python-openstackclient
+  - python-oslo.cache
+  - python-oslo.concurrency
+  - python-oslo.config
+  - python-oslo.context
+  - python-oslo.db
+  - python-oslo.i18n
+  - python-oslo.log
+  - python-oslo.messaging
+  - python-oslo.middleware
+  - python-oslo.policy
+  - python-oslo.serialization
+  - python-oslo.service
+  - python-oslo.utils
+  - python-pam
+  - python-passlib
+  - python-paste
+  - python-pastedeploy
+  - python-pbr
+  - python-pycadf
+  - python-pymysql
+  - python-pysaml2
+  - python-pysqlite2
+  - python-routes
+  - python-six
+  - python-sqlalchemy
+  - python-stevedore
+  - python-webob
+  - unzip
+  - python3-keystoneauth1
+  - python3-keystoneclient
+  - python3-oslo.config
+  - python3-oslo.context
+  - python3-oslo.i18n
+  - python3-oslo.serialization
+  - python-oslo.service
+  - python-oslo.utils
+  - python-pam
+  - python-passlib
+  - python-paste
+  - python-pastedeploy
+  - python-pbr
+  - python-pycadf
+  - python-pymysql
+  - python-pysaml2
+  - python-pysqlite2
+  - python-routes
+  - python-six
+  - python-sqlalchemy
+  - python-stevedore
+  - python-webob
+  - unzip
+  - python3-keystoneauth1
+  - python3-keystoneclient
+  - python3-oslo.config
+  - python3-oslo.context
+  - python3-oslo.i18n
+  - python3-oslo.serialization
+  - python3-oslo.utils
+  - apache2
+  - libapache2-mod-wsgi
+
+services:
+  - apache2
+
diff --git a/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/main.yml b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/main.yml
new file mode 100644 (file)
index 0000000..3a22d26
--- /dev/null
@@ -0,0 +1,14 @@
+##############################################################################
+# 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 distributi
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+
+packages_noarch: []
+
+services_noarch: []
+