From 31bc52f98aa708b03b9c4e2919fcb0b4d3c576a9 Mon Sep 17 00:00:00 2001 From: Yifei Xue Date: Thu, 12 May 2016 15:19:21 +0800 Subject: Add Mitaka package for Ubuntu 14.04 JIRA: COMPASS-387 Change-Id: I62da78a6aa252259265640b3ff84ad77c28fdece Signed-off-by: Yifei Xue --- build.sh | 8 ++ build/build.conf | 1 + build/make_repo.sh | 41 ++++++--- build/os/centos/rhel7/mitaka/Dockerfile.tmpl | 27 ++++++ build/os/ubuntu/trusty/mitaka/Dockerfile.tmpl | 26 ++++++ build/templates/Debian_mitaka.tmpl | 57 +++++++++++++ build/templates/RedHat_mitaka.tmpl | 98 ++++++++++++++++++++++ deploy/adapters/ansible/openstack_mitaka/.gitkeep | 0 .../openstack_mitaka/aodh/handlers/main.yml | 12 +++ .../ansible/openstack_mitaka/aodh/tasks/main.yml | 29 +++++++ .../openstack_mitaka/aodh/templates/aodh.conf.j2 | 41 +++++++++ .../aodh/templates/api_paste.ini.j2 | 22 +++++ .../openstack_mitaka/aodh/templates/policy.json.j2 | 20 +++++ .../ansible/openstack_mitaka/aodh/vars/Debian.yml | 22 +++++ .../ansible/openstack_mitaka/aodh/vars/RedHat.yml | 22 +++++ .../ansible/openstack_mitaka/aodh/vars/main.yml | 12 +++ .../ceilometer_controller/vars/Debian.yml | 37 ++++++++ .../ceilometer_controller/vars/RedHat.yml | 36 ++++++++ .../openstack_mitaka/common/vars/Debian.yml | 30 +++++++ .../adapters/ansible/roles/aodh/handlers/main.yml | 12 --- deploy/adapters/ansible/roles/aodh/tasks/main.yml | 29 ------- .../ansible/roles/aodh/templates/aodh.conf.j2 | 41 --------- .../ansible/roles/aodh/templates/api_paste.ini.j2 | 22 ----- .../ansible/roles/aodh/templates/policy.json.j2 | 20 ----- deploy/adapters/ansible/roles/aodh/vars/Debian.yml | 22 ----- deploy/adapters/ansible/roles/aodh/vars/RedHat.yml | 22 ----- deploy/adapters/ansible/roles/aodh/vars/main.yml | 12 --- .../roles/ceilometer_controller/vars/Debian.yml | 4 - .../roles/ceilometer_controller/vars/RedHat.yml | 3 - 29 files changed, 528 insertions(+), 200 deletions(-) create mode 100644 build/os/centos/rhel7/mitaka/Dockerfile.tmpl create mode 100644 build/os/ubuntu/trusty/mitaka/Dockerfile.tmpl create mode 100644 build/templates/Debian_mitaka.tmpl create mode 100644 build/templates/RedHat_mitaka.tmpl create mode 100644 deploy/adapters/ansible/openstack_mitaka/.gitkeep create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/handlers/main.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/tasks/main.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/templates/aodh.conf.j2 create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/templates/api_paste.ini.j2 create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/templates/policy.json.j2 create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/vars/Debian.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/vars/RedHat.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/aodh/vars/main.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/Debian.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/RedHat.yml create mode 100644 deploy/adapters/ansible/openstack_mitaka/common/vars/Debian.yml delete mode 100644 deploy/adapters/ansible/roles/aodh/handlers/main.yml delete mode 100644 deploy/adapters/ansible/roles/aodh/tasks/main.yml delete mode 100644 deploy/adapters/ansible/roles/aodh/templates/aodh.conf.j2 delete mode 100644 deploy/adapters/ansible/roles/aodh/templates/api_paste.ini.j2 delete mode 100644 deploy/adapters/ansible/roles/aodh/templates/policy.json.j2 delete mode 100644 deploy/adapters/ansible/roles/aodh/vars/Debian.yml delete mode 100644 deploy/adapters/ansible/roles/aodh/vars/RedHat.yml delete mode 100644 deploy/adapters/ansible/roles/aodh/vars/main.yml diff --git a/build.sh b/build.sh index 77a3b72c..9f959b01 100755 --- a/build.sh +++ b/build.sh @@ -120,6 +120,10 @@ function copy_file() cp $CACHE_DIR/`basename $TRUSTY_LIBERTY_PPA` $new/repos/cobbler/ubuntu/ppa/ -rf fi +# if [[ $TRUSTY_MITAKA_PPA ]]; then +# cp $CACHE_DIR/`basename $TRUSTY_MITAKA_PPA` $new/repos/cobbler/ubuntu/ppa/ -rf +# fi + if [[ $CENTOS_ISO ]]; then cp $CACHE_DIR/`basename $CENTOS_ISO` $new/repos/cobbler/centos/iso/ -rf fi @@ -136,6 +140,10 @@ function copy_file() cp $CACHE_DIR/`basename $CENTOS7_LIBERTY_PPA` $new/repos/cobbler/centos/ppa/ -rf fi +# if [[ $CENTOS7_MITAKA_PPA ]]; then +# cp $CACHE_DIR/`basename $CENTOS7_MITAKA_PPA` $new/repos/cobbler/centos/ppa/ -rf +# fi + cp $CACHE_DIR/`basename $LOADERS` $new/ -rf || exit 1 cp $CACHE_DIR/`basename $APP_PACKAGE` $new/app_packages/ -rf || exit 1 cp $CACHE_DIR/`basename $ANSIBLE_MODULE | sed 's/.git//g'` $new/ansible/ -rf || exit 1 diff --git a/build/build.conf b/build/build.conf index 50b31179..ad2a6b1b 100644 --- a/build/build.conf +++ b/build/build.conf @@ -23,6 +23,7 @@ export UBUNTU_ISO=${UBUNTU_ISO:-$PACKAGE_URL/ubuntu-14.04.3-server-amd64.iso} # OpenStack Packages for deployment #export TRUSTY_JUNO_PPA=${TRUSTY_JUNO_PPA:-$PACKAGE_URL/trusty-juno-ppa.tar.gz} export TRUSTY_LIBERTY_PPA=${TRUSTY_LIBERTY_PPA:-$PACKAGE_URL/trusty-liberty-ppa.tar.gz} +#export TRUSTY_MITAKA_PPA=${TRUSTY_MITAKA_PPA:-$PACKAGE_URL/trusty-mitaka-ppa.tar.gz} #export CENTOS7_JUNO_PPA=${CENTOS7_JUNO_PPA:-$PACKAGE_URL/centos7-juno-ppa.tar.gz} #export CENTOS7_KILO_PPA=${CENTOS7_KILO_PPA:-$PACKAGE_URL/centos7-kilo-ppa.tar.gz} export CENTOS7_LIBERTY_PPA=${CENTOS7_LIBERTY_PPA:-$PACKAGE_URL/centos7-liberty-ppa.tar.gz} diff --git a/build/make_repo.sh b/build/make_repo.sh index ce24b971..bebb5060 100755 --- a/build/make_repo.sh +++ b/build/make_repo.sh @@ -60,6 +60,7 @@ function make_repo() special_package_script_dir="" special_package_dir="" ansible_dir="" + ansible_dir_tmp="" while :; do case "$1" in --os-ver) os_ver=$2; shift 2;; @@ -108,7 +109,21 @@ function make_repo() tmpl=${BUILD_PATH}/templates/${arch}_${package_tag}.tmpl fi - python ${BUILD_PATH}/gen_ins_pkg_script.py "${ansible_dir}" "${arch}" "${tmpl}" \ + if [[ "${ansible_dir}" != "" ]]; then + # generate ansible_dir_tmp + if [[ -d ${WORK_PATH}/work/tmp ]]; then + rm -rf ${WORK_PATH}/work/tmp + fi + mkdir -p ${WORK_PATH}/work/tmp + echo "${ansible_dir}" + cp -rf ${ansible_dir}/roles/ ${WORK_PATH}/work/tmp/ + if [[ -d ${ansible_dir}/openstack_${package_tag} && "`ls ${ansible_dir}/openstack_${package_tag}`" != "" ]]; then + cp -rf ${ansible_dir}/openstack_${package_tag}/* ${WORK_PATH}/work/tmp/roles/ + fi + ansible_dir_tmp=${WORK_PATH}/work/tmp/ + fi + + python ${BUILD_PATH}/gen_ins_pkg_script.py "${ansible_dir_tmp}" "${arch}" "${tmpl}" \ "${docker_tmpl}" "${default_package}" "${special_package}" \ "${WORK_PATH}/work/repo/$arch/script/" \ "${WORK_PATH}/work/repo/$arch/packages/" @@ -169,18 +184,18 @@ function make_pip_repo() function make_all_repo() { -# make_repo --package-tag pip - -# make_repo --os-ver rhel7 --package-tag compass \ -# --tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \ -# --default-package "kernel-devel epel-release wget libxml2 glibc gcc perl openssl-libs mkisofs createrepo lsof \ -# python-yaml python-jinja2 python-paramiko elasticsearch logstash bind-license vim nmap-ncat \ -# yum cobbler cobbler-web createrepo mkisofs syslinux pykickstart bind rsync fence-agents \ -# dhcp xinetd tftp-server httpd libselinux-python python-setuptools python-devel mysql-devel \ -# mysql-server mysql MySQL-python redis mod_wsgi net-tools rabbitmq-server nfs-utils" \ -# --special-package "kibana jdk" - - for opv in juno kilo liberty; do + make_repo --package-tag pip + + make_repo --os-ver rhel7 --package-tag compass \ + --tmpl "${WORK_PATH}/build/templates/compass_core.tmpl" \ + --default-package "kernel-devel epel-release wget libxml2 glibc gcc perl openssl-libs mkisofs createrepo lsof \ + python-yaml python-jinja2 python-paramiko elasticsearch logstash bind-license vim nmap-ncat \ + yum cobbler cobbler-web createrepo mkisofs syslinux pykickstart bind rsync fence-agents \ + dhcp xinetd tftp-server httpd libselinux-python python-setuptools python-devel mysql-devel \ + mysql-server mysql MySQL-python redis mod_wsgi net-tools rabbitmq-server nfs-utils" \ + --special-package "kibana jdk" + + for opv in juno kilo liberty mitaka; do make_repo --os-ver trusty --package-tag $opv \ --ansible-dir $WORK_PATH/deploy/adapters/ansible \ --default-package "openssh-server" \ diff --git a/build/os/centos/rhel7/mitaka/Dockerfile.tmpl b/build/os/centos/rhel7/mitaka/Dockerfile.tmpl new file mode 100644 index 00000000..adb930ff --- /dev/null +++ b/build/os/centos/rhel7/mitaka/Dockerfile.tmpl @@ -0,0 +1,27 @@ +FROM centos:7.1.1503 +MAINTAINER Chigang(Justin) + +# set cache enable +RUN sed -i 's/keepcache=0/keepcache=1/g' /etc/yum.conf +#set packages = $getVar('spcial_packages', []) +#for package in $packages +ADD ./RedHat/packages/redhat_packages/$package /var/cache/yum/x86_64/7/base/packages/ +#end for +#set scripts = $getVar('scripts', []) +#for script in $scripts +ADD ./RedHat/script/$script /tmp/chigang/$script +RUN chmod +x /tmp/chigang/$script +RUN /tmp/chigang/$script +#end for +ADD ./comps.xml / +ADD ./ceph_key_release.asc / +ADD ./install_packages.sh /tmp/chigang/install_packages.sh +RUN chmod +x /tmp/chigang/install_packages.sh +RUN /tmp/chigang/install_packages.sh + +ADD ./cp_repo.sh /tmp/chigang/cp_repo.sh +RUN chmod +x /tmp/chigang/cp_repo.sh +RUN mkdir /result + +CMD ["/tmp/chigang/cp_repo.sh"] +#VOLUME /tmp/chigang diff --git a/build/os/ubuntu/trusty/mitaka/Dockerfile.tmpl b/build/os/ubuntu/trusty/mitaka/Dockerfile.tmpl new file mode 100644 index 00000000..ad14fa59 --- /dev/null +++ b/build/os/ubuntu/trusty/mitaka/Dockerfile.tmpl @@ -0,0 +1,26 @@ +FROM ubuntu:14.04.3 +MAINTAINER Chigang(Justin) + +#RUN apt-get update + +RUN rm -f /etc/apt/apt.conf.d/docker-clean +#set packages = $getVar('spcial_packages', []) +#for package in $packages +ADD ./Debian/packages/debian-packages/$package /var/cache/apt/archives/ +#end for +#set scripts = $getVar('scripts', []) +#for script in $scripts +ADD ./Debian/script/$script /tmp/chigang/$script +RUN chmod +x /tmp/chigang/$script +RUN /tmp/chigang/$script +#end for +ADD ./install_packages.sh /tmp/chigang/install_packages.sh +RUN chmod +x /tmp/chigang/install_packages.sh +RUN /tmp/chigang/install_packages.sh + +ADD ./cp_repo.sh /tmp/chigang/cp_repo.sh +RUN chmod +x /tmp/chigang/cp_repo.sh +RUN mkdir /result + +CMD ["/tmp/chigang/cp_repo.sh"] +#VOLUME /tmp/chigang diff --git a/build/templates/Debian_mitaka.tmpl b/build/templates/Debian_mitaka.tmpl new file mode 100644 index 00000000..7df519de --- /dev/null +++ b/build/templates/Debian_mitaka.tmpl @@ -0,0 +1,57 @@ +#!/bin/bash +set -ex + +#set OPV="mitaka" + +# add openstack $OPV repo +sudo apt-get update && apt-get install -y software-properties-common +sudo add-apt-repository -y cloud-archive:$OPV + +# add galeracluster repo +#sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db +#sudo add-apt-repository 'deb http://ftp.osuosl.org/pub/mariadb/repo/5.5/ubuntu trusty main' +sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 D669017EBC19DDBA +sudo add-apt-repository 'deb http://releases.galeracluster.com/ubuntu trusty main' +# add oracle java8 ppa +sudo add-apt-repository ppa:webupd8team/java +# add open java7 repo +sudo add-apt-repository 'deb http://security.ubuntu.com/ubuntu trusty-security main' + +sudo apt-get update + +sudo apt-get install reprepro -y + +sudo apt-get -d install pciutils -y + +cd /var/cache/apt/ +sudo apt-get download libexpat1 +cd - + +#download packages +#set packages = $getVar('default_packages', []) +#for pkg in $packages +sudo apt-get -d install $pkg -y +#end for +#set packages = $getVar('packages', []) +#for pkg in $packages +sudo apt-get -d install $pkg -y +#end for + +#make repo +mkdir -p trusty-$OPV-ppa/conf +cat < trusty-$OPV-ppa/conf/distributions +Codename: trusty +Components: main +Architectures: amd64 +EOF + +sudo apt-get install wget +wget -O /var/cache/apt/python-pyasn1_0.1.8-2_all.deb http://us.archive.ubuntu.com/ubuntu/pool/main/p/pyasn1/python-pyasn1_0.1.8-2_all.deb +rm -rf /var/cache/apt/python-pyasn1_0.1.7-1ubuntu2_all.deb + +mkdir deb +find /var/cache/apt/ -name *.deb | xargs -i cp {} deb + +reprepro -b trusty-$OPV-ppa includedeb trusty deb/*.deb + +tar -zcvf /trusty-$OPV-ppa.tar.gz ./trusty-$OPV-ppa diff --git a/build/templates/RedHat_mitaka.tmpl b/build/templates/RedHat_mitaka.tmpl new file mode 100644 index 00000000..07728289 --- /dev/null +++ b/build/templates/RedHat_mitaka.tmpl @@ -0,0 +1,98 @@ +#!/bin/bash +set -x + +#set OPV="mitaka" + +yum remove systemd -y +# add 163 repo +#rm -f /etc/yum.repos.d/CentOS-*.repo +yum repolist +yum clean all + +yum install yum-plugin-priorities -y +yum install http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm -y +yum install http://rdo.fedorapeople.org/openstack-$OPV/rdo-release-${OPV}.rpm -y + +# modify centos7 repo for workaround +sed -i 's/epel-Derived from Red Hat Enterprise Linux 7.1 (Source)/epel-7/g' /etc/yum.repos.d/rdo-release.repo + +# add mongodb repo +cat </etc/yum.repos.d/mongodb.repo +[mongodb] +name=MongoDB Repository +baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/ +gpgcheck=0 +enabled=1 +EOF + +# add galeracluster repo +cat </etc/yum.repos.d/MariaDB.repo +[mariadb] +name =MariaDB +baseurl = http://yum.mariadb.org/5.5/centos7-amd64 +gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB +gpgcheck=1 +EOF + +cat </etc/yum.repos.d/syslog.repo +[rsyslog_v7] +name=rsyslog +baseurl="http://rpms.adiscon.com/v7-stable/epel-7/x86_64" +enabled=1 +gpgcheck=0 +gpgkey=http://rpms.adiscon.com/RPM-GPG-KEY-Adiscon +protect=1 +EOF + +cat </etc/yum.repos.d/ceph.repo +[ceph] +name=Ceph packages for x86_64 +baseurl=http://ceph.com/rpm-hammer/rhel7/x86_64 +enabled=1 +priority=2 +gpgcheck=1 +type=rpm-md +gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc + +[ceph-noarch] +name=Ceph noarch packages +baseurl=http://ceph.com/rpm-hammer/rhel7/noarch +enabled=1 +priority=2 +gpgcheck=1 +type=rpm-md +gpgkey=https://ceph.com/git/?p=ceph.git;a=blob_plain;f=keys/release.asc +EOF + +cat <>/etc/yum.conf +exclude=mongodb-org,mongodb-org-server +EOF + +yum update -y +yum install createrepo tar -y + +yum -y install --downloadonly MariaDB-Galera-server +#download packages +#set packages = $getVar('default_packages', []) +yum -y install --skip-broken --downloadonly #echo ' '.join(packages) +#set packages = $getVar('packages', []) +#silent packages.pop(packages.index('MariaDB-Galera-server')) +yum -y install --skip-broken --downloadonly #echo ' '.join(packages) + +#make repo +mkdir -p /centos7-$OPV-ppa/{Packages,repodata} + +find /var/cache/yum/ -name "*.rpm" | xargs -i cp {} /centos7-$OPV-ppa/Packages/ + +rm /centos7-$OPV-ppa/Packages/selinux-policy* -f +rm /centos7-$OPV-ppa/Packages/systemd* -f + +mv /epel-release-7-5.noarch.rpm /centos7-$OPV-ppa/Packages/ +cp /comps.xml /centos7-$OPV-ppa/ +cp /ceph_key_release.asc /centos7-$OPV-ppa/ +createrepo -g comps.xml /centos7-$OPV-ppa +mkdir /centos7-$OPV-ppa/noarch +mkdir /centos7-$OPV-ppa/noarch/Packages +cp -r /centos7-$OPV-ppa/Packages/ceph* /centos7-$OPV-ppa/noarch/Packages/ +cp -r /centos7-$OPV-ppa/repodata/ /centos7-$OPV-ppa/noarch/ +tar -zcvf /centos7-$OPV-ppa.tar.gz /centos7-$OPV-ppa diff --git a/deploy/adapters/ansible/openstack_mitaka/.gitkeep b/deploy/adapters/ansible/openstack_mitaka/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/handlers/main.yml b/deploy/adapters/ansible/openstack_mitaka/aodh/handlers/main.yml new file mode 100644 index 00000000..e1084c83 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/handlers/main.yml @@ -0,0 +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 aodh services + service: name={{ item }} state=restarted enabled=yes + with_items: services diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/tasks/main.yml b/deploy/adapters/ansible/openstack_mitaka/aodh/tasks/main.yml new file mode 100644 index 00000000..aa23b9e5 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/tasks/main.yml @@ -0,0 +1,29 @@ +############################################################################## +# 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 aodh packages + action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" + with_items: packages | union(packages_noarch) + +- name: update aodh conf + template: src={{ item }} dest=/etc/aodh/{{ item }} + backup=yes + with_items: + - aodh.conf.j2 +# - api_paste.ini.j2 +# - policy.json.j2 + notify: restart aodh services + +- name: write services to monitor list + lineinfile: dest=/opt/service create=yes line='{{ item }}' + with_items: services + +- meta: flush_handlers diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/templates/aodh.conf.j2 b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/aodh.conf.j2 new file mode 100644 index 00000000..eac6e5bd --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/aodh.conf.j2 @@ -0,0 +1,41 @@ +[DEFAULT] +bind_host = {{ internal_ip }} +bind_port = 8042 +rpc_backend = rabbit +auth_strategy = keystone +debug = True +verbose = True + +[oslo_messaging_rabbit] +rabbit_hosts = {{ internal_vip.ip }} +rabbit_userid = {{ RABBIT_USER }} +rabbit_password = {{ RABBIT_PASS }} +rabbit_use_ssl = false + +[database] +connection = mongodb://aodh:{{ AODH_DBPASS }}@{{ internal_vip.ip }}:27017/aodh + +[keystone_authtoken] +auth_uri = http://{{ internal_vip.ip }}:5000 +auth_url = http://{{ internal_vip.ip }}:35357 +identity_uri = http://{{ internal_vip.ip }}:35357 +auth_plugin = password +project_domain_id = default +user_domain_id = default +project_name = service +username = aodh +password = {{ AODH_PASS }} +memcached_servers = {{ memcached_servers }} +token_cache_time = 300 +revocation_cache_time = 60 + +[service_credentials] +os_auth_url = http://{{ internal_vip.ip }}:5000/v2.0 +os_username = aodh +os_tenant_name = service +os_password = {{ AODH_PASS }} +os_endpoint_type = internalURL +os_region_name = regionOne + +[api] +host = {{ internal_ip }} diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/templates/api_paste.ini.j2 b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/api_paste.ini.j2 new file mode 100644 index 00000000..151789c4 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/api_paste.ini.j2 @@ -0,0 +1,22 @@ +# aodh API WSGI Pipeline +# Define the filters that make up the pipeline for processing WSGI requests +# Note: This pipeline is PasteDeploy's term rather than aodh's pipeline +# used for processing samples + +# Remove authtoken from the pipeline if you don't want to use keystone authentication +[pipeline:main] +pipeline = cors request_id authtoken api-server + +[app:api-server] +paste.app_factory = aodh.api.app:app_factory + +[filter:authtoken] +paste.filter_factory = keystonemiddleware.auth_token:filter_factory +oslo_config_project = aodh + +[filter:request_id] +paste.filter_factory = oslo_middleware:RequestId.factory + +[filter:cors] +paste.filter_factory = oslo_middleware.cors:filter_factory +oslo_config_project = aodh diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/templates/policy.json.j2 b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/policy.json.j2 new file mode 100644 index 00000000..4fd873e9 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/templates/policy.json.j2 @@ -0,0 +1,20 @@ +{ + "context_is_admin": "role:admin", + "segregation": "rule:context_is_admin", + "admin_or_owner": "rule:context_is_admin or project_id:%(project_id)s", + "default": "rule:admin_or_owner", + + "telemetry:get_alarm": "rule:admin_or_owner", + "telemetry:get_alarms": "rule:admin_or_owner", + "telemetry:query_alarm": "rule:admin_or_owner", + + "telemetry:create_alarm": "", + "telemetry:change_alarm": "rule:admin_or_owner", + "telemetry:delete_alarm": "rule:admin_or_owner", + + "telemetry:get_alarm_state": "rule:admin_or_owner", + "telemetry:change_alarm_state": "rule:admin_or_owner", + + "telemetry:alarm_history": "rule:admin_or_owner", + "telemetry:query_alarm_history": "rule:admin_or_owner" +} diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/vars/Debian.yml b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/Debian.yml new file mode 100644 index 00000000..bdf4655e --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/Debian.yml @@ -0,0 +1,22 @@ +############################################################################# +# 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: + - aodh-api + - aodh-evaluator + - aodh-notifier + - aodh-listener + - aodh-expirer + - python-ceilometerclient + +services: + - aodh-api + - aodh-notifier + - aodh-evaluator + - aodh-listener diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/vars/RedHat.yml b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/RedHat.yml new file mode 100644 index 00000000..3d182880 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/RedHat.yml @@ -0,0 +1,22 @@ +############################################################################# +# 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: + - openstack-aodh-api + - openstack-aodh-evaluator + - openstack-aodh-notifier + - openstack-aodh-listener + - openstack-aodh-expirer + - python-ceilometerclient + +services: + - aodh-api + - aodh-notifier + - aodh-evaluator + - aodh-listener diff --git a/deploy/adapters/ansible/openstack_mitaka/aodh/vars/main.yml b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/main.yml new file mode 100644 index 00000000..b17f6ed0 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/aodh/vars/main.yml @@ -0,0 +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 +############################################################################### +--- +packages_noarch: [] + +services_noarch: [] diff --git a/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/Debian.yml b/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/Debian.yml new file mode 100644 index 00000000..b749ffaa --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/Debian.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 +############################################################################## +--- +ceilometer_packages: + - ceilometer-api + - ceilometer-collector + - ceilometer-agent-central + - ceilometer-agent-notification +# - ceilometer-alarm-evaluator +# - ceilometer-alarm-notifier + - python-ceilometerclient + +ceilometer_services: + - ceilometer-agent-central + - ceilometer-agent-notification + - ceilometer-api + - ceilometer-collector +# - ceilometer-alarm-evaluator +# - ceilometer-alarm-notifier + +ceilometer_configs_templates: + - src: ceilometer.j2 + dest: + - /etc/ceilometer/ceilometer.conf + - src: cinder.j2 + dest: + - /etc/cinder/cinder.conf + - src: glance.j2 + dest: + - /etc/glance/glance-api.conf + - /etc/glance/glance-registry.conf diff --git a/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/RedHat.yml b/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/RedHat.yml new file mode 100644 index 00000000..6c5f53ec --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/ceilometer_controller/vars/RedHat.yml @@ -0,0 +1,36 @@ +############################################################################## +# 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 +############################################################################## +--- +ceilometer_packages: + - openstack-ceilometer-api + - openstack-ceilometer-collector + - openstack-ceilometer-central + - openstack-ceilometer-notification +# - openstack-ceilometer-alarm + - python-ceilometerclient + +ceilometer_services: + - openstack-ceilometer-central + - openstack-ceilometer-notification + - openstack-ceilometer-api + - openstack-ceilometer-collector +# - openstack-ceilometer-alarm-evaluator +# - openstack-ceilometer-alarm-notifier + +ceilometer_configs_templates: + - src: ceilometer.j2 + dest: + - /etc/ceilometer/ceilometer.conf + - src: cinder.j2 + dest: + - /etc/cinder/cinder.conf + - src: glance.j2 + dest: + - /etc/glance/glance-api.conf + - /etc/glance/glance-registry.conf diff --git a/deploy/adapters/ansible/openstack_mitaka/common/vars/Debian.yml b/deploy/adapters/ansible/openstack_mitaka/common/vars/Debian.yml new file mode 100644 index 00000000..980bcac9 --- /dev/null +++ b/deploy/adapters/ansible/openstack_mitaka/common/vars/Debian.yml @@ -0,0 +1,30 @@ +############################################################################## +# 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: + - ubuntu-cloud-keyring + #- python-dev + - openvswitch-datapath-dkms + - openvswitch-switch + - python-memcache + - python-iniparse + - python-lxml +# - python-d* #TODO, need remove + +pip_packages: + - crudini + - python-keyczar + - yang2tosca + +pip_conf: pip.conf + +services: + - ntp + + diff --git a/deploy/adapters/ansible/roles/aodh/handlers/main.yml b/deploy/adapters/ansible/roles/aodh/handlers/main.yml deleted file mode 100644 index e1084c83..00000000 --- a/deploy/adapters/ansible/roles/aodh/handlers/main.yml +++ /dev/null @@ -1,12 +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 -############################################################################## ---- -- name: restart aodh services - service: name={{ item }} state=restarted enabled=yes - with_items: services diff --git a/deploy/adapters/ansible/roles/aodh/tasks/main.yml b/deploy/adapters/ansible/roles/aodh/tasks/main.yml deleted file mode 100644 index aa23b9e5..00000000 --- a/deploy/adapters/ansible/roles/aodh/tasks/main.yml +++ /dev/null @@ -1,29 +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 aodh packages - action: "{{ ansible_pkg_mgr }} name={{ item }} state=present" - with_items: packages | union(packages_noarch) - -- name: update aodh conf - template: src={{ item }} dest=/etc/aodh/{{ item }} - backup=yes - with_items: - - aodh.conf.j2 -# - api_paste.ini.j2 -# - policy.json.j2 - notify: restart aodh services - -- name: write services to monitor list - lineinfile: dest=/opt/service create=yes line='{{ item }}' - with_items: services - -- meta: flush_handlers diff --git a/deploy/adapters/ansible/roles/aodh/templates/aodh.conf.j2 b/deploy/adapters/ansible/roles/aodh/templates/aodh.conf.j2 deleted file mode 100644 index eac6e5bd..00000000 --- a/deploy/adapters/ansible/roles/aodh/templates/aodh.conf.j2 +++ /dev/null @@ -1,41 +0,0 @@ -[DEFAULT] -bind_host = {{ internal_ip }} -bind_port = 8042 -rpc_backend = rabbit -auth_strategy = keystone -debug = True -verbose = True - -[oslo_messaging_rabbit] -rabbit_hosts = {{ internal_vip.ip }} -rabbit_userid = {{ RABBIT_USER }} -rabbit_password = {{ RABBIT_PASS }} -rabbit_use_ssl = false - -[database] -connection = mongodb://aodh:{{ AODH_DBPASS }}@{{ internal_vip.ip }}:27017/aodh - -[keystone_authtoken] -auth_uri = http://{{ internal_vip.ip }}:5000 -auth_url = http://{{ internal_vip.ip }}:35357 -identity_uri = http://{{ internal_vip.ip }}:35357 -auth_plugin = password -project_domain_id = default -user_domain_id = default -project_name = service -username = aodh -password = {{ AODH_PASS }} -memcached_servers = {{ memcached_servers }} -token_cache_time = 300 -revocation_cache_time = 60 - -[service_credentials] -os_auth_url = http://{{ internal_vip.ip }}:5000/v2.0 -os_username = aodh -os_tenant_name = service -os_password = {{ AODH_PASS }} -os_endpoint_type = internalURL -os_region_name = regionOne - -[api] -host = {{ internal_ip }} diff --git a/deploy/adapters/ansible/roles/aodh/templates/api_paste.ini.j2 b/deploy/adapters/ansible/roles/aodh/templates/api_paste.ini.j2 deleted file mode 100644 index 151789c4..00000000 --- a/deploy/adapters/ansible/roles/aodh/templates/api_paste.ini.j2 +++ /dev/null @@ -1,22 +0,0 @@ -# aodh API WSGI Pipeline -# Define the filters that make up the pipeline for processing WSGI requests -# Note: This pipeline is PasteDeploy's term rather than aodh's pipeline -# used for processing samples - -# Remove authtoken from the pipeline if you don't want to use keystone authentication -[pipeline:main] -pipeline = cors request_id authtoken api-server - -[app:api-server] -paste.app_factory = aodh.api.app:app_factory - -[filter:authtoken] -paste.filter_factory = keystonemiddleware.auth_token:filter_factory -oslo_config_project = aodh - -[filter:request_id] -paste.filter_factory = oslo_middleware:RequestId.factory - -[filter:cors] -paste.filter_factory = oslo_middleware.cors:filter_factory -oslo_config_project = aodh diff --git a/deploy/adapters/ansible/roles/aodh/templates/policy.json.j2 b/deploy/adapters/ansible/roles/aodh/templates/policy.json.j2 deleted file mode 100644 index 4fd873e9..00000000 --- a/deploy/adapters/ansible/roles/aodh/templates/policy.json.j2 +++ /dev/null @@ -1,20 +0,0 @@ -{ - "context_is_admin": "role:admin", - "segregation": "rule:context_is_admin", - "admin_or_owner": "rule:context_is_admin or project_id:%(project_id)s", - "default": "rule:admin_or_owner", - - "telemetry:get_alarm": "rule:admin_or_owner", - "telemetry:get_alarms": "rule:admin_or_owner", - "telemetry:query_alarm": "rule:admin_or_owner", - - "telemetry:create_alarm": "", - "telemetry:change_alarm": "rule:admin_or_owner", - "telemetry:delete_alarm": "rule:admin_or_owner", - - "telemetry:get_alarm_state": "rule:admin_or_owner", - "telemetry:change_alarm_state": "rule:admin_or_owner", - - "telemetry:alarm_history": "rule:admin_or_owner", - "telemetry:query_alarm_history": "rule:admin_or_owner" -} diff --git a/deploy/adapters/ansible/roles/aodh/vars/Debian.yml b/deploy/adapters/ansible/roles/aodh/vars/Debian.yml deleted file mode 100644 index bdf4655e..00000000 --- a/deploy/adapters/ansible/roles/aodh/vars/Debian.yml +++ /dev/null @@ -1,22 +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 -############################################################################# ---- -packages: - - aodh-api - - aodh-evaluator - - aodh-notifier - - aodh-listener - - aodh-expirer - - python-ceilometerclient - -services: - - aodh-api - - aodh-notifier - - aodh-evaluator - - aodh-listener diff --git a/deploy/adapters/ansible/roles/aodh/vars/RedHat.yml b/deploy/adapters/ansible/roles/aodh/vars/RedHat.yml deleted file mode 100644 index 3d182880..00000000 --- a/deploy/adapters/ansible/roles/aodh/vars/RedHat.yml +++ /dev/null @@ -1,22 +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 -############################################################################# ---- -packages: - - openstack-aodh-api - - openstack-aodh-evaluator - - openstack-aodh-notifier - - openstack-aodh-listener - - openstack-aodh-expirer - - python-ceilometerclient - -services: - - aodh-api - - aodh-notifier - - aodh-evaluator - - aodh-listener diff --git a/deploy/adapters/ansible/roles/aodh/vars/main.yml b/deploy/adapters/ansible/roles/aodh/vars/main.yml deleted file mode 100644 index b17f6ed0..00000000 --- a/deploy/adapters/ansible/roles/aodh/vars/main.yml +++ /dev/null @@ -1,12 +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 -############################################################################### ---- -packages_noarch: [] - -services_noarch: [] diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml index 6615317d..55f5aa19 100644 --- a/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml +++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/Debian.yml @@ -12,8 +12,6 @@ ceilometer_packages: - ceilometer-collector - ceilometer-agent-central - ceilometer-agent-notification - - ceilometer-alarm-evaluator - - ceilometer-alarm-notifier - python-ceilometerclient ceilometer_services: @@ -21,8 +19,6 @@ ceilometer_services: - ceilometer-agent-notification - ceilometer-api - ceilometer-collector - - ceilometer-alarm-evaluator - - ceilometer-alarm-notifier ceilometer_configs_templates: - src: ceilometer.j2 diff --git a/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml index f1eb4e5b..86f464a5 100644 --- a/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml +++ b/deploy/adapters/ansible/roles/ceilometer_controller/vars/RedHat.yml @@ -12,7 +12,6 @@ ceilometer_packages: - openstack-ceilometer-collector - openstack-ceilometer-central - openstack-ceilometer-notification - - openstack-ceilometer-alarm - python-ceilometerclient ceilometer_services: @@ -20,8 +19,6 @@ ceilometer_services: - openstack-ceilometer-notification - openstack-ceilometer-api - openstack-ceilometer-collector - - openstack-ceilometer-alarm-evaluator - - openstack-ceilometer-alarm-notifier ceilometer_configs_templates: - src: ceilometer.j2 -- cgit 1.2.3-korg