aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/openstack_mitaka_xenial/roles
diff options
context:
space:
mode:
authorchenshuai@huawei.com <chenshuai@huawei.com>2016-07-21 05:38:08 -0400
committerchenshuai@huawei.com <chenshuai@huawei.com>2016-07-21 05:38:08 -0400
commitc15131e20fbdd9abc469a11dd5f817a7ff1f8be6 (patch)
tree26f253b7299598c27736c40cc85a2b62fce47d07 /deploy/adapters/ansible/openstack_mitaka_xenial/roles
parent72d0c28f4c695870ed17c134c51d471853a3f84e (diff)
NewFeature: add moon in Compass
JIRA: COMPASS-443 Change-Id: If792ca91af9ad7cddfee5d4ad5355655385f1913 Signed-off-by: chenshuai@huawei.com <chenshuai@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/openstack_mitaka_xenial/roles')
-rw-r--r--deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/keystone-moon-install.yml73
-rw-r--r--deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/main.yml37
-rw-r--r--deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/Debian.yml92
-rw-r--r--deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/main.yml14
4 files changed, 216 insertions, 0 deletions
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
index 00000000..71315f82
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/keystone-moon-install.yml
@@ -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
index 00000000..31802e10
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/tasks/main.yml
@@ -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
index 00000000..42177d42
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/Debian.yml
@@ -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
index 00000000..3a22d268
--- /dev/null
+++ b/deploy/adapters/ansible/openstack_mitaka_xenial/roles/moon/vars/main.yml
@@ -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: []
+